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.9.1 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.9.0 lib/mongo_mapper/extensions/set.rb
ign-mongo_mapper-0.8.6.2 lib/mongo_mapper/extensions/set.rb
ign-mongo_mapper-0.8.6.1 lib/mongo_mapper/extensions/set.rb
ssherman-mongo_mapper-0.8.6 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.8.6 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.8.5 lib/mongo_mapper/extensions/set.rb
honkster-mongo_mapper-0.8.4 lib/mongo_mapper/extensions/set.rb
mongo_mapper-0.8.4 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.19 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.18 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.17 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.16 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.15 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.14 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.13 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.12 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.11 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.10 lib/mongo_mapper/extensions/set.rb
mongo_mapper-unstable-2010.08.09 lib/mongo_mapper/extensions/set.rb