Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Treat DateTime objects as :time

  • Loading branch information...
commit fc8cc0362f564bdf00499fa636b1ee96825faeed 1 parent 254073c
@jcoyne jcoyne authored
Showing with 3 additions and 0 deletions.
  1. +2 −0  lib/solrizer/field_mapper.rb
  2. +1 −0  spec/units/field_mapper_spec.rb
View
2  lib/solrizer/field_mapper.rb
@@ -168,6 +168,8 @@ def extract_type(value)
when NilClass
when Fixnum
:integer
+ when DateTime
+ :time
else
value.class.to_s.underscore.to_sym
end
View
1  spec/units/field_mapper_spec.rb
@@ -146,6 +146,7 @@ def fungible_type(type)
@mapper.extract_type(nil).should == nil
@mapper.extract_type(Date.today).should == :date
@mapper.extract_type(Time.now).should == :time
+ @mapper.extract_type(DateTime.now).should == :time
@mapper.extract_type("Hi").should == :string
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.