Module: Mongo::Model::Rails

Defined in:
lib/mongo/model/integration/rails.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#new_record?Boolean

Returns:



23
# File 'lib/mongo/model/integration/rails.rb', line 23

def new_record?; new? end

#persisted?Boolean

Returns:



17
# File 'lib/mongo/model/integration/rails.rb', line 17

def persisted?; _saved end

#to_keyObject



19
20
21
# File 'lib/mongo/model/integration/rails.rb', line 19

def to_key
  persisted? ? [id] : nil
end

#to_modelObject



15
# File 'lib/mongo/model/integration/rails.rb', line 15

def to_model; self end