Sha256: f323dd26e45ca5c3b4ae8950711c061d25ab8d070bb081a60ef5796158dd874a

Contents?: true

Size: 615 Bytes

Versions: 42

Compression:

Stored size: 615 Bytes

Contents

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

42 entries across 42 versions & 1 rubygems

Version Path
mongoid-0.9.4 lib/mongoid/extensions/array/conversions.rb
mongoid-0.9.3 lib/mongoid/extensions/array/conversions.rb
mongoid-0.9.2 lib/mongoid/extensions/array/conversions.rb
mongoid-0.9.1 lib/mongoid/extensions/array/conversions.rb
mongoid-0.9.0 lib/mongoid/extensions/array/conversions.rb
mongoid-0.8.10 lib/mongoid/extensions/array/conversions.rb
mongoid-0.8.9 lib/mongoid/extensions/array/conversions.rb
mongoid-0.8.8 lib/mongoid/extensions/array/conversions.rb
mongoid-0.8.7 lib/mongoid/extensions/array/conversions.rb
mongoid-0.8.6 lib/mongoid/extensions/array/conversions.rb
mongoid-0.8.5 lib/mongoid/extensions/array/conversions.rb
mongoid-0.8.4 lib/mongoid/extensions/array/conversions.rb
mongoid-0.8.3 lib/mongoid/extensions/array/conversions.rb
mongoid-0.8.2 lib/mongoid/extensions/array/conversions.rb
mongoid-0.8.1 lib/mongoid/extensions/array/conversions.rb
mongoid-0.7.10 lib/mongoid/extensions/array/conversions.rb
mongoid-0.7.9 lib/mongoid/extensions/array/conversions.rb
mongoid-0.7.8 lib/mongoid/extensions/array/conversions.rb
mongoid-0.7.7 lib/mongoid/extensions/array/conversions.rb
mongoid-0.7.6 lib/mongoid/extensions/array/conversions.rb