Sha256: 4a1cf8a9f20e5c2e38ecaeef88ae4b2572a2bf531663dd66622a37393d011259

Contents?: true

Size: 468 Bytes

Versions: 34

Compression:

Stored size: 468 Bytes

Contents

# encoding: UTF-8
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 include?(*args)
          load_target
          target.include?(*args)
        end

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

Version data entries

34 entries across 34 versions & 8 rubygems

Version Path
mongo_mapper-0.12.0 lib/mongo_mapper/plugins/associations/collection.rb
lookout-mongo_mapper-0.11.3 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.11.2 lib/mongo_mapper/plugins/associations/collection.rb
jamieorc-mongo_mapper-0.11.1.1 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.11.1 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.11.0 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.10.1 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.10.0 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.9.2 lib/mongo_mapper/plugins/associations/collection.rb
jonbell-mongo_mapper-0.8.6 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.9.1 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.9.0 lib/mongo_mapper/plugins/associations/collection.rb
ign-mongo_mapper-0.8.6.2 lib/mongo_mapper/plugins/associations/collection.rb
ign-mongo_mapper-0.8.6.1 lib/mongo_mapper/plugins/associations/collection.rb
ssherman-mongo_mapper-0.8.6 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.8.6 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.8.5 lib/mongo_mapper/plugins/associations/collection.rb
honkster-mongo_mapper-0.8.4 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.8.4 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.08.19 lib/mongo_mapper/plugins/associations/collection.rb