Sha256: 25db9d940b2e273b344db8cbbe2a75751b9eb6e3eb741ebc76b8d3b6f4407b46

Contents?: true

Size: 633 Bytes

Versions: 61

Compression:

Stored size: 633 Bytes

Contents

# encoding: utf-8
module Mongoid #:nodoc:
  module Extensions #:nodoc:
    module Array #:nodoc:
      # This module converts arrays into mongoid related objects.
      module Conversions #:nodoc:
        # Converts this array into an array of hashes.
        def mongoidize
          collect { |obj| obj.attributes }
        end

        def self.included(base)
          base.class_eval do
            extend ClassMethods
          end
        end

        module ClassMethods
          def get(value)
            value
          end
          def set(value)
            value
          end
        end
      end
    end
  end
end

Version data entries

61 entries across 61 versions & 4 rubygems

Version Path
mongoid-1.9.5 lib/mongoid/extensions/array/conversions.rb
mongoid-with-auth-1.9.4 lib/mongoid/extensions/array/conversions.rb
mongoid-rails2-1.9.4 lib/mongoid/extensions/array/conversions.rb
mongoid-rails2-1.9.3 lib/mongoid/extensions/array/conversions.rb
mongoid-1.9.2 lib/mongoid/extensions/array/conversions.rb
sskirby-mongoid-1.9.1 lib/mongoid/extensions/array/conversions.rb
mongoid-1.9.1 lib/mongoid/extensions/array/conversions.rb
mongoid-1.9.0 lib/mongoid/extensions/array/conversions.rb
mongoid-1.2.14 lib/mongoid/extensions/array/conversions.rb
mongoid-1.2.13 lib/mongoid/extensions/array/conversions.rb
mongoid-1.2.12 lib/mongoid/extensions/array/conversions.rb
mongoid-1.2.11 lib/mongoid/extensions/array/conversions.rb
mongoid-1.2.10 lib/mongoid/extensions/array/conversions.rb
mongoid-1.2.9 lib/mongoid/extensions/array/conversions.rb
mongoid-1.2.8 lib/mongoid/extensions/array/conversions.rb
mongoid-1.2.7 lib/mongoid/extensions/array/conversions.rb
mongoid-1.2.6 lib/mongoid/extensions/array/conversions.rb
mongoid-1.2.5 lib/mongoid/extensions/array/conversions.rb
mongoid-1.2.4 lib/mongoid/extensions/array/conversions.rb
mongoid-1.2.3 lib/mongoid/extensions/array/conversions.rb