diff --git a/lib/thinking_sphinx/active_record/attribute/sphinx_presenter.rb b/lib/thinking_sphinx/active_record/attribute/sphinx_presenter.rb index 35bbff3ab..28b87fef0 100644 --- a/lib/thinking_sphinx/active_record/attribute/sphinx_presenter.rb +++ b/lib/thinking_sphinx/active_record/attribute/sphinx_presenter.rb @@ -4,7 +4,7 @@ class ThinkingSphinx::ActiveRecord::Attribute::SphinxPresenter SPHINX_TYPES = { :integer => :uint, :boolean => :bool, - :timestamp => :timestamp, + :timestamp => :uint, :float => :float, :string => :string, :bigint => :bigint, diff --git a/lib/thinking_sphinx/real_time/index.rb b/lib/thinking_sphinx/real_time/index.rb index 634a16f48..f5db245e8 100644 --- a/lib/thinking_sphinx/real_time/index.rb +++ b/lib/thinking_sphinx/real_time/index.rb @@ -65,12 +65,10 @@ def append_unique_attribute(collection, attribute) def collection_for(attribute) case attribute.type - when :integer, :boolean + when :integer, :boolean, :timestamp attribute.multi? ? @rt_attr_multi : @rt_attr_uint when :string @rt_attr_string - when :timestamp - @rt_attr_timestamp when :float @rt_attr_float when :bigint diff --git a/spec/thinking_sphinx/active_record/sql_source_spec.rb b/spec/thinking_sphinx/active_record/sql_source_spec.rb index 9b0be0887..800e4cd29 100644 --- a/spec/thinking_sphinx/active_record/sql_source_spec.rb +++ b/spec/thinking_sphinx/active_record/sql_source_spec.rb @@ -325,14 +325,14 @@ expect(source.sql_attr_string).to include('name') end - it "adds timestamp attributes to sql_attr_timestamp" do + it "adds timestamp attributes to sql_attr_uint" do source.attributes << double('attribute') allow(presenter).to receive_messages :declaration => 'created_at', - :collection_type => :timestamp + :collection_type => :uint source.render - expect(source.sql_attr_timestamp).to include('created_at') + expect(source.sql_attr_uint).to include('created_at') end it "adds float attributes to sql_attr_float" do