Module: Mongoid::Extensions::Array::Conversions
- Included in:
- Array
- Defined in:
- lib/mongoid/extensions/array/conversions.rb
Overview
This module converts arrays into mongoid related objects.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#mongoidize ⇒ Object
Converts this array into an array of hashes.
Class Method Details
.included(base) ⇒ Object
12 13 14 15 16 |
# File 'lib/mongoid/extensions/array/conversions.rb', line 12 def self.included(base) base.class_eval do extend ClassMethods end end |
Instance Method Details
#mongoidize ⇒ Object
Converts this array into an array of hashes.
8 9 10 |
# File 'lib/mongoid/extensions/array/conversions.rb', line 8 def mongoidize collect { |obj| obj.attributes } end |