1. mirror
  2. rails

Commits

tenderlove  committed 4ae4828

backporting a couple missing files. sorry folks!

  • Participants
  • Parent commits f57ca87
  • Branches 2-3-stable

Comments (0)

Files changed (2)

File activesupport/lib/active_support/core_ext/kernel/singleton_class.rb

View file
+module Kernel
+  # Returns the object's singleton class.
+  def singleton_class
+    class << self
+      self
+    end
+  end unless respond_to?(:singleton_class) # exists in 1.9.2
+
+  # class_eval on an object acts like singleton_class.class_eval.
+  def class_eval(*args, &block)
+    singleton_class.class_eval(*args, &block)
+  end
+end

File activesupport/lib/active_support/core_ext/module/remove_method.rb

View file
+class Module
+  def remove_possible_method(method)
+    remove_method(method)
+  rescue NameError
+  end
+end