Sha256: 01e6b1948ce6782300f2ceec7eba9ff367d56db10af470118846a10818803b51

Contents?: true

Size: 412 Bytes

Versions: 23

Compression:

Stored size: 412 Bytes

Contents

# encoding: utf-8
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

23 entries across 23 versions & 1 rubygems

Version Path
mongoid-0.11.7 lib/mongoid/extensions/time/conversions.rb
mongoid-0.11.6 lib/mongoid/extensions/time/conversions.rb
mongoid-0.11.5 lib/mongoid/extensions/time/conversions.rb
mongoid-0.11.4 lib/mongoid/extensions/time/conversions.rb
mongoid-0.11.3 lib/mongoid/extensions/time/conversions.rb
mongoid-0.11.2 lib/mongoid/extensions/time/conversions.rb
mongoid-0.11.1 lib/mongoid/extensions/time/conversions.rb
mongoid-0.11.0 lib/mongoid/extensions/time/conversions.rb
mongoid-0.10.6 lib/mongoid/extensions/time/conversions.rb
mongoid-0.10.5 lib/mongoid/extensions/time/conversions.rb
mongoid-0.10.4 lib/mongoid/extensions/time/conversions.rb
mongoid-0.10.3 lib/mongoid/extensions/time/conversions.rb
mongoid-0.10.2 lib/mongoid/extensions/time/conversions.rb
mongoid-0.10.1 lib/mongoid/extensions/time/conversions.rb
mongoid-0.10.0 lib/mongoid/extensions/time/conversions.rb
mongoid-0.9.12 lib/mongoid/extensions/time/conversions.rb
mongoid-0.9.11 lib/mongoid/extensions/time/conversions.rb
mongoid-0.9.10 lib/mongoid/extensions/time/conversions.rb
mongoid-0.9.9 lib/mongoid/extensions/time/conversions.rb
mongoid-0.9.8 lib/mongoid/extensions/time/conversions.rb