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

- (Boolean) persisted?

Returns:



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

def persisted?
  !new_record?
end

- (Object) to_key



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

def to_key
  persisted? ? super : nil
end