searchlogic 2.3.11 → 2.3.12

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -2,4 +2,4 @@
2
2
  :major: 2
3
3
  :minor: 3
4
4
  :build:
5
- :patch: 11
5
+ :patch: 12
@@ -169,8 +169,17 @@ module Searchlogic
169
169
  # with the other models.
170
170
  column_for_type_cast = ::ActiveRecord::ConnectionAdapters::Column.new("", nil)
171
171
  column_for_type_cast.instance_variable_set(:@type, type)
172
- value = column_for_type_cast.type_cast(value)
173
- Time.zone && value.is_a?(Time) ? value.in_time_zone : value
172
+ casted_value = column_for_type_cast.type_cast(value)
173
+
174
+ if Time.zone && casted_value.is_a?(Time)
175
+ if value.is_a?(String)
176
+ (casted_value + (Time.zone.utc_offset * -1)).in_time_zone
177
+ else
178
+ casted_value.in_time_zone
179
+ end
180
+ else
181
+ casted_value
182
+ end
174
183
  end
175
184
  end
176
185
 
data/searchlogic.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{searchlogic}
8
- s.version = "2.3.11"
8
+ s.version = "2.3.12"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ben Johnson of Binary Logic"]
data/spec/search_spec.rb CHANGED
@@ -261,13 +261,13 @@ describe "Search" do
261
261
  it "should be a Time given 'Jan 1, 2009'" do
262
262
  search = Order.search
263
263
  search.created_at_after = "Jan 1, 2009"
264
- search.created_at_after.should == Time.parse("Jan 1, 2009")
264
+ search.created_at_after.should == Time.zone.parse("Jan 1, 2009")
265
265
  end
266
266
 
267
267
  it "should be a Time given 'Jan 1, 2009 9:33AM'" do
268
268
  search = Order.search
269
269
  search.created_at_after = "Jan 1, 2009 9:33AM"
270
- search.created_at_after.should == Time.parse("Jan 1, 2009 9:33AM")
270
+ search.created_at_after.should == Time.zone.parse("Jan 1, 2009 9:33AM")
271
271
  end
272
272
 
273
273
  it "should convert the time to the current zone" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchlogic
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.11
4
+ version: 2.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Johnson of Binary Logic