Add method comment.
This commit is contained in:
parent
ce80cd768e
commit
6927601e2b
|
@ -2,10 +2,6 @@ class Version < ActiveRecord::Base
|
||||||
belongs_to :item, :polymorphic => true
|
belongs_to :item, :polymorphic => true
|
||||||
validates_presence_of :event
|
validates_presence_of :event
|
||||||
|
|
||||||
def changeset
|
|
||||||
YAML::load(object_changes) if Version.method_defined?(:object_changes) && object_changes
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.with_item_keys(item_type, item_id)
|
def self.with_item_keys(item_type, item_id)
|
||||||
scoped(:conditions => { :item_type => item_type, :item_id => item_id })
|
scoped(:conditions => { :item_type => item_type, :item_id => item_id })
|
||||||
end
|
end
|
||||||
|
@ -83,6 +79,11 @@ class Version < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns what changed in this version of the item. Cf. `ActiveModel::Dirty#changes`.
|
||||||
|
def changeset
|
||||||
|
YAML::load(object_changes) if Version.method_defined?(:object_changes) && object_changes
|
||||||
|
end
|
||||||
|
|
||||||
# Returns who put the item into the state stored in this version.
|
# Returns who put the item into the state stored in this version.
|
||||||
def originator
|
def originator
|
||||||
previous.try :whodunnit
|
previous.try :whodunnit
|
||||||
|
|
Loading…
Reference in New Issue