Module: Mongoid::Document

Defined in:
lib/mongoid_integer_keys.rb

Instance Method Summary collapse

Instance Method Details

#as_documentObject



24
25
26
27
28
29
30
# File 'lib/mongoid_integer_keys.rb', line 24

def as_document
  result = super_as_document
  if result["_id"].blank?
    result["_id"] = Identity.new(self).generate_id
  end
  result
end

#identifyObject



20
21
# File 'lib/mongoid_integer_keys.rb', line 20

def identify
end

#super_as_documentObject



23
# File 'lib/mongoid_integer_keys.rb', line 23

alias_method :super_as_document,:as_document