Sha256: 131bfebdc0b5f8efbea3a6ea0715d850e49556227eb334783ecc5ad2aa6a854f

Contents?: true

Size: 354 Bytes

Versions: 62

Compression:

Stored size: 354 Bytes

Contents

module MongoMapper
  module Plugins
    module Associations
      class Collection < Proxy
        def to_ary
          load_target
          if target.is_a?(Array)
            target.to_ary
          else
            Array(target)
          end
        end

        def reset
          super
          target = []
        end
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 9 rubygems

Version Path
pwnash-mongo_mapper-0.7.5 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.7.6 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.7.5 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper_ign-0.7.4 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.7.4 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.7.3 lib/mongo_mapper/plugins/associations/collection.rb
numon-0.0.1 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.7.2 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.7.1 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.3.8 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.3.5 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.3.4 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.3.3 lib/mongo_mapper/plugins/associations/collection.rb
drogus-mongo_mapper-0.6.10 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-rails3-0.7.0.1 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.28 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.27 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.26 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.25 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.24 lib/mongo_mapper/plugins/associations/collection.rb