test/groupdate_test.rb in groupdate-0.1.6 vs test/groupdate_test.rb in groupdate-1.0.0
- old
+ new
@@ -243,16 +243,14 @@
def assert_zeros_tz(method, created_at, keys, range_start, range_end)
assert_zeros method, created_at, keys, range_start, range_end, "Pacific Time (US & Canada)", true
end
- def time_key(key, java_hack = false)
+ def time_key(key)
if RUBY_PLATFORM == "java"
if User.connection.adapter_name == "PostgreSQL"
Time.parse(key).utc.strftime("%Y-%m-%d %H:%M:%S%z")[0..-3]
- elsif java_hack
- Time.parse(key).utc.strftime("%Y-%m-%d %H:%M:%S")
else
Time.parse(key).strftime("%Y-%m-%d %H:%M:%S").gsub(/ 00\:00\:00\z/, "")
end
else
if User.connection.adapter_name == "PostgreSQL" and ActiveRecord::VERSION::MAJOR == 3
@@ -261,12 +259,12 @@
Time.parse(key)
end
end
end
- def number_key(key, java_hack = false)
+ def number_key(key)
if RUBY_PLATFORM == "java"
- if User.connection.adapter_name == "PostgreSQL" and !java_hack
+ if User.connection.adapter_name == "PostgreSQL"
key.to_f
else
key
end
else