mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use ActiveSupport beta since beta1 is not released yet. Added singleton_class until beta1 is out.
This commit is contained in:
parent
b04ebb7602
commit
2700d6c044
2 changed files with 14 additions and 1 deletions
|
@ -28,5 +28,5 @@ and query generation.
|
|||
# circular dependency chain. The solution is for ActiveRecord to release
|
||||
# the connection adapters which Arel uses in a separate gem
|
||||
# s.add_dependency "activerecord", ">= 3.0.pre"
|
||||
s.add_dependency "activesupport", ">= 3.0.0.beta1"
|
||||
s.add_dependency "activesupport", ">= 3.0.0.beta"
|
||||
end
|
||||
|
|
|
@ -12,6 +12,19 @@ module Arel
|
|||
yield(self)
|
||||
end
|
||||
|
||||
# TODO remove this when ActiveSupport beta1 is out.
|
||||
# Returns the object's singleton class.
|
||||
def singleton_class
|
||||
class << self
|
||||
self
|
||||
end
|
||||
end unless respond_to?(:singleton_class)
|
||||
|
||||
# class_eval on an object acts like singleton_class_eval.
|
||||
def class_eval(*args, &block)
|
||||
singleton_class.class_eval(*args, &block)
|
||||
end
|
||||
|
||||
Object.send(:include, self)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue