Sha256: 110d383e46f62cbb52075ec751dfa4218d3d4e6f9c0e3587f2d2d40f3c78b7f0

Contents?: true

Size: 372 Bytes

Versions: 40

Compression:

Stored size: 372 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 reset
          super
          target = []
        end
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 5 rubygems

Version Path
mongo_mapper-unstable-2010.08.04 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.08.03 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.08.02 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.08.01 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.07.31 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.07.30 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.07.29 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.07.28 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.07.27 lib/mongo_mapper/plugins/associations/collection.rb
thorsson-mongo_mapper-0.8.2 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.07.26 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.07.23 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.07.21 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.07.20 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.07.19 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.07.18 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.07.16 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.07.15 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.07.14 lib/mongo_mapper/plugins/associations/collection.rb
mongo_mapper-unstable-2010.07.13 lib/mongo_mapper/plugins/associations/collection.rb