lib/moribus.rb
# Set id, updated_at and created_at to nil in order to
# update them when new record is created.
Set id, updated_at and created_at to nil in order to
update them when new record is created.
Set id updated_at and created_at to nil in order to update them when new record is created .
def reset_persistence_values
    self.id = nil
    if respond_to?(:updated_at=)
      self.updated_at = nil
      self.updated_at_will_change!
    end
    if respond_to?(:created_at=)
      self.created_at = nil
      self.created_at_will_change!
    end
    (attributes.keys - changes.keys).each{ |key| self.send(:"#{key}_will_change!") }
  end
def reset_persistence_values self . id = nil if respond_to? ( :updated_at= ) self . updated_at = nil self . updated_at_will_change! end if respond_to? ( :created_at= ) self . created_at = nil self . created_at_will_change! end ( attributes . keys - changes . keys ) . each { | key | self . send ( :" #{ key } _will_change! " ) } end
Set id, updated_at and created_at to nil in order to
update them when new record is created.
Set id updated_at and created_at to nil in order to update them when new record is created .
# mark all other attributes is changing