Skip to content

Commit

Permalink
Add method comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
airblade committed Jul 13, 2011
1 parent ce80cd7 commit 6927601
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/paper_trail/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ class Version < ActiveRecord::Base
belongs_to :item, :polymorphic => true
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)
scoped(:conditions => { :item_type => item_type, :item_id => item_id })
end
Expand Down Expand Up @@ -83,6 +79,11 @@ def reify(options = {})
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.
def originator
previous.try :whodunnit
Expand Down

0 comments on commit 6927601

Please sign in to comment.