Sha256: a7882178daf00f615580c4e24bd90070d797486b5702e2f73d627e46b8eec914

Contents?: true

Size: 280 Bytes

Versions: 81

Compression:

Stored size: 280 Bytes

Contents

# encoding: UTF-8
require 'set'

module MongoMapper
  module Extensions
    module Set
      def to_mongo(value)
        value.to_a
      end

      def from_mongo(value)
        (value || []).to_set
      end
    end
  end
end

class Set
  extend MongoMapper::Extensions::Set
end

Version data entries

81 entries across 81 versions & 9 rubygems

Version Path
mongo_mapper-0.8.3 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.08 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.06 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.05 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.04 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.03 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.02 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.01 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.07.31 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.07.30 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.07.29 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.07.28 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.07.27 lib/mongo_mapper/extensions/set.rb
thorsson-mongo_mapper-0.8.2 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.07.26 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.07.23 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.07.21 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.07.20 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.07.19 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.07.18 lib/mongo_mapper/extensions/set.rb