aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2010-03-25 15:57:45 -0300
committerEmilio Tagua <miloops@gmail.com>2010-03-25 15:57:45 -0300
commit2700d6c04436be383b1b099559002d851f0aca50 (patch)
treeed4a799ce0cd1aa062feaa3a258ef74abdd08cc4 /lib
parentb04ebb7602d4e318469977649cf7a02f381b3143 (diff)
downloadrails-2700d6c04436be383b1b099559002d851f0aca50.tar.gz
rails-2700d6c04436be383b1b099559002d851f0aca50.tar.bz2
rails-2700d6c04436be383b1b099559002d851f0aca50.zip
Use ActiveSupport beta since beta1 is not released yet. Added singleton_class until beta1 is out.
Diffstat (limited to 'lib')
-rw-r--r--lib/arel/algebra/core_extensions/object.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/arel/algebra/core_extensions/object.rb b/lib/arel/algebra/core_extensions/object.rb
index 85a4d951a4..82fa28546c 100644
--- a/lib/arel/algebra/core_extensions/object.rb
+++ b/lib/arel/algebra/core_extensions/object.rb
@@ -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