Rename of scope: 'after' to 'following'
This commit is contained in:
parent
02d3bce542
commit
bd89516fd0
|
@ -97,7 +97,7 @@ module PaperTrail
|
|||
def version_at(timestamp, reify_options={})
|
||||
# Because a version stores how its object looked *before* the change,
|
||||
# we need to look for the first version created *after* the timestamp.
|
||||
v = send(self.class.versions_association_name).after(timestamp).first
|
||||
v = send(self.class.versions_association_name).following(timestamp).first
|
||||
v ? v.reify(reify_options) : self
|
||||
end
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class Version < ActiveRecord::Base
|
|||
where(["#{self.primary_key} < ?", version.is_a?(self) ? version.id : version]).order("#{self.primary_key} DESC")
|
||||
}
|
||||
|
||||
scope :after, lambda { |timestamp|
|
||||
scope :following, lambda { |timestamp|
|
||||
# TODO: is this :order necessary, considering its presence on the has_many :versions association?
|
||||
where(['created_at > ?', timestamp]).order("created_at ASC, #{self.primary_key} ASC")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue