Module: Hirb::Views::MongoDb

Defined in:
lib/hirb/views/mongo_db.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#mongo_mapper__document_view(obj) ⇒ Object Also known as: mongo_mapper__embedded_document_view



6
7
8
9
10
# File 'lib/hirb/views/mongo_db.rb', line 6

def mongo_mapper__document_view(obj)
  fields = obj.class.column_names
  fields.delete('_id') && fields.unshift('_id')
  {:fields=>fields}
end

#mongoid__document_view(obj) ⇒ Object



2
3
4
# File 'lib/hirb/views/mongo_db.rb', line 2

def mongoid__document_view(obj)
  {:fields=>['_id'] + obj.class.fields.keys}
end