aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorYehuda Katz <wycats@yehuda-katzs-macbookpro41.local>2009-06-02 22:06:21 -0700
committerYehuda Katz <wycats@yehuda-katzs-macbookpro41.local>2009-06-02 22:06:21 -0700
commitd6e4113c83a9d55be6f2af247da2cecaa855f43b (patch)
treeb0be336385aec7383950889029c28ad8db61e46f /activesupport/lib
parent6b4da2ecacc28d7e50aa0e0123b5f4564d6e92c2 (diff)
downloadrails-d6e4113c83a9d55be6f2af247da2cecaa855f43b.tar.gz
rails-d6e4113c83a9d55be6f2af247da2cecaa855f43b.tar.bz2
rails-d6e4113c83a9d55be6f2af247da2cecaa855f43b.zip
YAGNI Method references. Deprecated
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/new_callbacks.rb17
1 files changed, 5 insertions, 12 deletions
diff --git a/activesupport/lib/active_support/new_callbacks.rb b/activesupport/lib/active_support/new_callbacks.rb
index 6023fc1170..237a285665 100644
--- a/activesupport/lib/active_support/new_callbacks.rb
+++ b/activesupport/lib/active_support/new_callbacks.rb
@@ -180,9 +180,10 @@ module ActiveSupport
filter = <<-RUBY_EVAL
unless halted
result = #{@filter}
- halted ||= (#{terminator})
+ halted = (#{terminator})
end
RUBY_EVAL
+
[@compiled_options[0], filter, @compiled_options[1]].compact.join("\n")
else
# Compile around filters with conditions into proxy methods
@@ -201,7 +202,7 @@ module ActiveSupport
# end
name = "_conditional_callback_#{@kind}_#{next_id}"
- txt = <<-RUBY_EVAL
+ txt, line = <<-RUBY_EVAL, __LINE__
def #{name}(halted)
#{@compiled_options[0] || "if true"} && !halted
#{@filter} do
@@ -212,7 +213,7 @@ module ActiveSupport
end
end
RUBY_EVAL
- @klass.class_eval(txt)
+ @klass.class_eval(txt, __FILE__, line)
"#{name}(halted) do"
end
end
@@ -291,15 +292,7 @@ module ActiveSupport
" self, Proc.new "
else
""
- end
- when Method
- @klass.send(:define_method, "#{method_name}_method") { filter }
- @klass.class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
- def #{method_name}(&blk)
- #{method_name}_method.call(self, &blk)
- end
- RUBY_EVAL
- method_name
+ end
when String
@klass.class_eval <<-RUBY_EVAL
def #{method_name}