aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-01-25 13:53:20 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-01-25 13:53:20 +1100
commiteef9d83ff28b9d3fdea11dabfab465adefbdf683 (patch)
treeafd7f731ba0043a1da2f01229ec59fe8d6be5a0e
parentc6f3630c4723194c74721300156fa464009285a6 (diff)
Remove timezone monkeypatch fixes because they're not necessary in Rails 3 anymore
-rw-r--r--config/initializers/alaveteli.rb1
-rw-r--r--lib/timezone_fixes.rb26
-rw-r--r--spec/lib/timezone_fixes_spec.rb5
3 files changed, 5 insertions, 27 deletions
diff --git a/config/initializers/alaveteli.rb b/config/initializers/alaveteli.rb
index c9eb3715a..56a2bce63 100644
--- a/config/initializers/alaveteli.rb
+++ b/config/initializers/alaveteli.rb
@@ -68,7 +68,6 @@ WillPaginate::ViewHelpers.pagination_options[:renderer] = 'WillPaginateExtension
# Load monkey patches and other things from lib/
require 'ruby19.rb'
require 'activesupport_cache_extensions.rb'
-require 'timezone_fixes.rb'
require 'use_spans_for_errors.rb'
require 'make_html_4_compliant.rb'
require 'activerecord_errors_extensions.rb'
diff --git a/lib/timezone_fixes.rb b/lib/timezone_fixes.rb
deleted file mode 100644
index 1bf326ccd..000000000
--- a/lib/timezone_fixes.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# Taken from
-# https://rails.lighthouseapp.com/projects/8994/tickets/2946
-# http://github.com/rails/rails/commit/6f97ad07ded847f29159baf71050c63f04282170
-
-# Otherwise times get stored wrong during British Summer Time
-
-# Hopefully fixed in later Rails. There is a test in spec/lib/timezone_fixes_spec.rb
-
-# This fix is applied in Rails 3.x. So, should be possible to remove this then!
-
-# Monkeypatch!
-module ActiveRecord
- module ConnectionAdapters # :nodoc:
- module Quoting
- def quoted_date(value)
- if value.acts_like?(:time)
- zone_conversion_method = ActiveRecord::Base.default_timezone == :utc ? :getutc : :getlocal
- value.respond_to?(zone_conversion_method) ? value.send(zone_conversion_method) : value
- else
- value
- end.to_s(:db)
- end
- end
- end
-end
-
diff --git a/spec/lib/timezone_fixes_spec.rb b/spec/lib/timezone_fixes_spec.rb
index 9d6ade526..8a9a3bf31 100644
--- a/spec/lib/timezone_fixes_spec.rb
+++ b/spec/lib/timezone_fixes_spec.rb
@@ -3,6 +3,11 @@
# We use MailServerLogDone here just as a totally random model that has a datetime type.
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+# In Rails 3 the monkeypatch that these tests are testing is not necessary. So,
+# since these tests are testing the Rails internals you could argue that they shouldn't
+# be here. Well, you're right. But let's leave them in for the time being until the upgrade is finished.
+# Then, we should probably delete this whole file
+
describe "when doing things with timezones" do
it "should preserve time objects with local time conversion to default timezone UTC