Module: RedisModelExtension::Dirty::ClassMethods

Defined in:
lib/redis-model-extension/dirty.rb

Instance Method Summary collapse

Instance Method Details

#new_by_key(key) ⇒ Object

hook to reset changed attributes, when load by .find or .get



35
36
37
38
39
# File 'lib/redis-model-extension/dirty.rb', line 35

def new_by_key(key)
  new_instance = super
  new_instance.changed_attributes.clear
  new_instance
end