Rename of scope: 'after' to 'following'

This commit is contained in:
Travis Jeffery 2012-01-12 04:04:44 +00:00
parent 02d3bce542
commit bd89516fd0
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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")
}