Sha256: 053b18b7ba1e9936afc9bee382427d728a9623df2527984e6dc50a13f8e3dad3

Contents?: true

Size: 297 Bytes

Versions: 11

Compression:

Stored size: 297 Bytes

Contents

# encoding: UTF-8
module MongoMapper
  module Extensions
    module Symbol
      def to_mongo(value)
        value && value.to_s.to_sym
      end

      def from_mongo(value)
        value && value.to_s.to_sym
      end
    end
  end
end

class Symbol
  extend MongoMapper::Extensions::Symbol
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mongo_mapper-0.16.0 lib/mongo_mapper/extensions/symbol.rb
mongo_mapper-0.15.6 lib/mongo_mapper/extensions/symbol.rb
mongo_mapper-0.15.5 lib/mongo_mapper/extensions/symbol.rb
mongo_mapper-0.15.4 lib/mongo_mapper/extensions/symbol.rb
mongo_mapper-0.15.3 lib/mongo_mapper/extensions/symbol.rb
mongo_mapper-0.15.2 lib/mongo_mapper/extensions/symbol.rb
mongo_mapper-0.15.1 lib/mongo_mapper/extensions/symbol.rb
mongo_mapper-0.15.0 lib/mongo_mapper/extensions/symbol.rb
mongo_mapper-0.14.0 lib/mongo_mapper/extensions/symbol.rb
mongo_mapper-0.14.0.rc1 lib/mongo_mapper/extensions/symbol.rb
mongo_mapper-0.13.1 lib/mongo_mapper/extensions/symbol.rb