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
mongo_mapper-unstable-2010.2.23 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.22 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.19 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.18 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.17 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.16 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.15 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.12 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.11 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.10 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.7.0 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.9 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.8 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.5 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.4 lib/mongo_mapper/plugins/associations/collection.rb
novelys_mongo_mapper-0.6.12 lib/novelys_mongo_mapper/plugins/associations/collection.rb
novelys_mongo_mapper-0.6.11 lib/novelys_mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.3 lib/mongo_mapper/plugins/associations/collection.rb
novelys_mongo_mapper-0.6.10 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.2.2 lib/mongo_mapper/plugins/associations/collection.rb