lib/moribus.rb
# Save persistence values of id, updated_at and created_at to instance
# variable to have an ability to set them back if object fails to
# be saved.
Save persistence values of id, updated_at and created_at to instance
variable to have an ability to set them back if object fails to
be saved.
Save persistence values of id updated_at and created_at to instance variable to have an ability to set them back if object fails to be saved .
def store_before_to_new_record_values
    values = {:id => id}
    values[:updated_at] = updated_at if respond_to?(:updated_at)
    values[:created_at] = created_at if respond_to?(:created_at)
    @_before_to_new_record_values = values
  end
def store_before_to_new_record_values values = { :id => id } values [ :updated_at ] = updated_at if respond_to? ( :updated_at ) values [ :created_at ] = created_at if respond_to? ( :created_at ) @_before_to_new_record_values = values end
Save persistence values of id, updated_at and created_at to instance
variable to have an ability to set them back if object fails to
be saved.
Save persistence values of id updated_at and created_at to instance variable to have an ability to set them back if object fails to be saved .