Module: Her::Model::ORM::PersistanceMethods

Extended by:
ActiveSupport::Concern
Included in:
Her::Model::ORM
Defined in:
lib/her/model/orm/persistance_methods.rb

Instance Method Summary collapse

Instance Method Details

#destroyed?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/her/model/orm/persistance_methods.rb', line 16

def destroyed?
  @metadata.include?(:destroyed) && @metadata[:destroyed] == true
end

#new?Boolean Also known as: new_record?

Returns:

  • (Boolean)


7
8
9
# File 'lib/her/model/orm/persistance_methods.rb', line 7

def new?
  !@data.include?(:id)
end

#persisted?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/her/model/orm/persistance_methods.rb', line 12

def persisted?
  !new_record?
end