Sha256: 8b81d6fa09e3d9175248deba44ad1bf460b4ec44548057ee6c71a8a40e701e27
Contents?: true
Size: 492 Bytes
Versions: 21
Compression:
Stored size: 492 Bytes
Contents
module Hirb::Views::MongoDb #:nodoc: def mongoid__document_view(obj) fields = obj.class.fields.keys fields.delete('_id') fields.unshift('_id') {:fields=>fields} end def mongo_mapper__document_view(obj) fields = obj.class.column_names fields.delete('_id') && fields.unshift('_id') {:fields=>fields} end alias_method :mongo_mapper__embedded_document_view, :mongo_mapper__document_view end Hirb::DynamicView.add Hirb::Views::MongoDb, :helper=>:auto_table
Version data entries
21 entries across 20 versions & 3 rubygems