lib/moribus.rb
# Marks +self+ as persistent record. If another record is passed, uses its
# persistence attributes (id, timestamps). If nil is passed as an argument,
# marks +self+ as persisted record and sets +id+ to memorized value.
Marks +self+ as persistent record. If another record is passed, uses its
persistence attributes (id, timestamps). If nil is passed as an argument,
marks +self+ as persisted record and sets +id+ to memorized value.
Marks + self + as persistent record . If another record is passed uses its persistence attributes ( id timestamps ) . If nil is passed as an argument marks + self + as persisted record and sets + id + to memorized value .
def to_persistent!(existing = nil)
    if existing
      self.id         = existing.id
      self.created_at = existing.created_at if respond_to?(:created_at)
      self.updated_at = existing.updated_at if respond_to?(:updated_at)
      clear_changes_information
    else
      restore_before_to_new_record_values
      clear_attribute_change(:created_at) if respond_to?(:created_at)
      clear_attribute_change(:updated_at) if respond_to?(:updated_at)
    end
    @new_record = false
    true
  end
def to_persistent! ( existing = nil ) if existing self . id = existing . id self . created_at = existing . created_at if respond_to? ( :created_at ) self . updated_at = existing . updated_at if respond_to? ( :updated_at ) clear_changes_information else restore_before_to_new_record_values clear_attribute_change ( :created_at ) if respond_to? ( :created_at ) clear_attribute_change ( :updated_at ) if respond_to? ( :updated_at ) end @new_record = false true end
Marks +self+ as persistent record.
Marks + self + as persistent record .
existing