Sha256: 89f52f7df60ab5b2d55c403b1a9a42a33307a200202d09c02e9b3acc9b491584

Contents?: true

Size: 394 Bytes

Versions: 14

Compression:

Stored size: 394 Bytes

Contents

module Mongoid #:nodoc:
  module Extensions #:nodoc:
    module Time #:nodoc:
      module Conversions #:nodoc:
        def set(value)
          return nil if value.blank?
          ::Time.parse(value.to_s).utc
        end
        def get(value)
          return nil if value.blank?
          ::Time.zone ? ::Time.zone.parse(value.to_s).getlocal : value
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
mongoid-0.9.4 lib/mongoid/extensions/time/conversions.rb
mongoid-0.9.3 lib/mongoid/extensions/time/conversions.rb
mongoid-0.9.2 lib/mongoid/extensions/time/conversions.rb
mongoid-0.9.1 lib/mongoid/extensions/time/conversions.rb
mongoid-0.9.0 lib/mongoid/extensions/time/conversions.rb
mongoid-0.8.10 lib/mongoid/extensions/time/conversions.rb
mongoid-0.8.9 lib/mongoid/extensions/time/conversions.rb
mongoid-0.8.8 lib/mongoid/extensions/time/conversions.rb
mongoid-0.8.7 lib/mongoid/extensions/time/conversions.rb
mongoid-0.8.6 lib/mongoid/extensions/time/conversions.rb
mongoid-0.8.5 lib/mongoid/extensions/time/conversions.rb
mongoid-0.8.4 lib/mongoid/extensions/time/conversions.rb
mongoid-0.8.3 lib/mongoid/extensions/time/conversions.rb
mongoid-0.8.2 lib/mongoid/extensions/time/conversions.rb