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-unstable-2010.08.18 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.08.17 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.08.16 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.08.15 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.08.14 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.08.13 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.08.12 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.08.11 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.08.10 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.08.09 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-0.8.3 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.08.08 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.08.06 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.08.05 lib/mongo_mapper/plugins/associations/collection.rb