diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-10-29 12:18:21 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-10-29 12:18:21 +0000 |
commit | 8bd85eb0b35211a653243ec740a9b3a9368e882f (patch) | |
tree | fdb5b1e49056f6f2888b87338b60e70d440e66b5 /config/initializers/rails2314_ruby193_monkey_patches.rb | |
parent | 96e980b6836f8c696429838258d2cc0778d8dcec (diff) |
Remove files checked in by mistake.
Diffstat (limited to 'config/initializers/rails2314_ruby193_monkey_patches.rb')
-rw-r--r-- | config/initializers/rails2314_ruby193_monkey_patches.rb | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/config/initializers/rails2314_ruby193_monkey_patches.rb b/config/initializers/rails2314_ruby193_monkey_patches.rb deleted file mode 100644 index 8bc433b13..000000000 --- a/config/initializers/rails2314_ruby193_monkey_patches.rb +++ /dev/null @@ -1 +0,0 @@ -# # -*- encoding : utf-8 -*-
# # This little guy is needed unless you want to define a helper for every single one of your controllers
# MissingSourceFile::REGEXPS << [/^cannot load such file -- (.+)$/i, 1]
#
# # TZInfo needs to be patched. In particular, you'll need to re-implement the datetime_new! method:
# require 'tzinfo'
#
# module TZInfo
#
# # Methods to support different versions of Ruby.
# module RubyCoreSupport #:nodoc:
# # Ruby 1.8.6 introduced new! and deprecated new0.
# # Ruby 1.9.0 removed new0.
# # Ruby trunk revision 31668 removed the new! method.
# # Still support new0 for better performance on older versions of Ruby (new0 indicates
# # that the rational has already been reduced to its lowest terms).
# # Fallback to jd with conversion from ajd if new! and new0 are unavailable.
# if DateTime.respond_to? :new!
# def self.datetime_new!(ajd = 0, of = 0, sg = Date::ITALY)
# DateTime.new!(ajd, of, sg)
# end
# elsif DateTime.respond_to? :new0
# def self.datetime_new!(ajd = 0, of = 0, sg = Date::ITALY)
# DateTime.new0(ajd, of, sg)
# end
# else
# HALF_DAYS_IN_DAY = rational_new!(1, 2)
#
# def self.datetime_new!(ajd = 0, of = 0, sg = Date::ITALY)
# # Convert from an Astronomical Julian Day number to a civil Julian Day number.
# jd = ajd + of + HALF_DAYS_IN_DAY
#
# # Ruby trunk revision 31862 changed the behaviour of DateTime.jd so that it will no
# # longer accept a fractional civil Julian Day number if further arguments are specified.
# # Calculate the hours, minutes and seconds to pass to jd.
#
# jd_i = jd.to_i
# jd_i -= 1 if jd < 0
# hours = (jd - jd_i) * 24
# hours_i = hours.to_i
# minutes = (hours - hours_i) * 60
# minutes_i = minutes.to_i
# seconds = (minutes - minutes_i) * 60
#
# DateTime.jd(jd_i, hours_i, minutes_i, seconds, of, sg)
# end
# end
# end
# end
#
# # Finally, we have this innocuous looking patch. Without it, queries like this: current_account.tickets.recent.count
# # would instantiate AR objects all (!!) tickets in the account, not merely return a count of the recent ones.
# # See https://rails.lighthouseapp.com/projects/8994/tickets/5410-multiple-database-queries-when-chaining-named-scopes-with-rails-238-and-ruby-192
# # (The patch in that lighthouse bug was not, in fact, merged in).
# module ActiveRecord
# module Associations
# class AssociationProxy
# def respond_to_missing?(meth, incl_priv)
# false
# end
# end
# end
# end
\ No newline at end of file |