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.15.3 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.15.2 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.15.1 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.15.0 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.14.0 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.14.0.rc1 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.13.1 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.13.0 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.13.0.beta2 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.13.0.beta1 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.12.0 lib/mongo_mapper/extensions/set.rb
lookout-mongo_mapper-0.11.3 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.11.2 lib/mongo_mapper/extensions/set.rb
jamieorc-mongo_mapper-0.11.1.1 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.11.1 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.11.0 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.10.1 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.10.0 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.9.2 lib/mongo_mapper/extensions/set.rb
jonbell-mongo_mapper-0.8.6 lib/mongo_mapper/extensions/set.rb