aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-04-22 17:17:31 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-04-22 17:17:31 -0700
commit5c4ba6e3fc66a779c28a70b8d7bde14b49e7c36c (patch)
treea1d7dc1605edd6b9a0d72b150b166d014ece20af /activesupport
parentb2d6fdae353be4fca41d7ac1839f30d9737162fd (diff)
downloadrails-5c4ba6e3fc66a779c28a70b8d7bde14b49e7c36c.tar.gz
rails-5c4ba6e3fc66a779c28a70b8d7bde14b49e7c36c.tar.bz2
rails-5c4ba6e3fc66a779c28a70b8d7bde14b49e7c36c.zip
new_callbacks core extensions
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/new_callbacks.rb3
-rw-r--r--activesupport/test/new_callbacks_test.rb10
2 files changed, 8 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/new_callbacks.rb b/activesupport/lib/active_support/new_callbacks.rb
index 356d70b650..7a48dbac04 100644
--- a/activesupport/lib/active_support/new_callbacks.rb
+++ b/activesupport/lib/active_support/new_callbacks.rb
@@ -1,3 +1,6 @@
+require 'active_support/core_ext/array/wrap'
+require 'active_support/core_ext/class/inheritable_attributes'
+
module ActiveSupport
# Callbacks are hooks into the lifecycle of an object that allow you to trigger logic
# before or after an alteration of the object state.
diff --git a/activesupport/test/new_callbacks_test.rb b/activesupport/test/new_callbacks_test.rb
index 5cde078b65..abe7790ebf 100644
--- a/activesupport/test/new_callbacks_test.rb
+++ b/activesupport/test/new_callbacks_test.rb
@@ -19,11 +19,11 @@ module NewCallbacksTest
class << self
def callback_symbol(callback_method)
- returning(:"#{callback_method}_method") do |method_name|
- define_method(method_name) do
- history << [callback_method, :symbol]
- end
+ method_name = :"#{callback_method}_method"
+ define_method(method_name) do
+ history << [callback_method, :symbol]
end
+ method_name
end
def callback_string(callback_method)
@@ -381,4 +381,4 @@ module NewCallbacksTest
assert_equal ["first", "second", "third", "second", "first"], terminator.history
end
end
-end \ No newline at end of file
+end