Module: MongoModel::ActiveModelCompatibility

Extended by:
ActiveSupport::Concern
Includes:
ActiveModel::Conversion
Included in:
EmbeddedDocument
Defined in:
lib/mongomodel/concerns/activemodel.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#persisted?Boolean

Returns:



7
8
9
# File 'lib/mongomodel/concerns/activemodel.rb', line 7

def persisted?
  !new_record?
end

#to_keyObject



11
12
13
# File 'lib/mongomodel/concerns/activemodel.rb', line 11

def to_key
  persisted? ? super : nil
end