Module: HasVersions::Record::Reset

Extended by:
ActiveSupport::Concern
Defined in:
lib/has_versions/record/reset.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#reset!(version) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/has_versions/record/reset.rb', line 14

def reset!(version)
  self.class.versioned_attributes.each do |attribute|
    value = self.class.versioning_decode_value(attribute, version.snapshot[attribute])
    send("#{attribute}=", value)
  end
  self
end