diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2012-05-08 23:56:25 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2012-05-08 23:56:25 +0530 |
commit | 7918d7bf5c6f0ce53e648c793f6034d6216a4808 (patch) | |
tree | febc17be0b2768394b67a14fa7dee842d3bde3b6 /actionpack/lib/abstract_controller | |
parent | 882e750cbe09450388190e92e2d92eac352b40fa (diff) | |
parent | 7e26f7f0f7e3c230c333e1b265727a9b8cf7c91f (diff) | |
download | rails-7918d7bf5c6f0ce53e648c793f6034d6216a4808.tar.gz rails-7918d7bf5c6f0ce53e648c793f6034d6216a4808.tar.bz2 rails-7918d7bf5c6f0ce53e648c793f6034d6216a4808.zip |
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'actionpack/lib/abstract_controller')
-rw-r--r-- | actionpack/lib/abstract_controller/callbacks.rb | 20 | ||||
-rw-r--r-- | actionpack/lib/abstract_controller/helpers.rb | 6 |
2 files changed, 13 insertions, 13 deletions
diff --git a/actionpack/lib/abstract_controller/callbacks.rb b/actionpack/lib/abstract_controller/callbacks.rb index c0fa28cae9..520c210721 100644 --- a/actionpack/lib/abstract_controller/callbacks.rb +++ b/actionpack/lib/abstract_controller/callbacks.rb @@ -163,11 +163,11 @@ module AbstractController class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1 # Append a before, after or around filter. See _insert_callbacks # for details on the allowed parameters. - def #{filter}_filter(*names, &blk) # def before_filter(*names, &blk) - _insert_callbacks(names, blk) do |name, options| # _insert_callbacks(names, blk) do |name, options| - set_callback(:process_action, :#{filter}, name, options) # set_callback(:process_action, :before, name, options) - end # end - end # end + def #{filter}_filter(*names, &blk) # def before_filter(*names, &blk) + _insert_callbacks(names, blk) do |name, options| # _insert_callbacks(names, blk) do |name, options| + set_callback(:process_action, :#{filter}, name, options) # set_callback(:process_action, :before, name, options) + end # end + end # end # Prepend a before, after or around filter. See _insert_callbacks # for details on the allowed parameters. @@ -179,11 +179,11 @@ module AbstractController # Skip a before, after or around filter. See _insert_callbacks # for details on the allowed parameters. - def skip_#{filter}_filter(*names) # def skip_before_filter(*names) - _insert_callbacks(names) do |name, options| # _insert_callbacks(names) do |name, options| - skip_callback(:process_action, :#{filter}, name, options) # skip_callback(:process_action, :before, name, options) - end # end - end # end + def skip_#{filter}_filter(*names) # def skip_before_filter(*names) + _insert_callbacks(names) do |name, options| # _insert_callbacks(names) do |name, options| + skip_callback(:process_action, :#{filter}, name, options) # skip_callback(:process_action, :before, name, options) + end # end + end # end # *_filter is the same as append_*_filter alias_method :append_#{filter}_filter, :#{filter}_filter # alias_method :append_before_filter, :before_filter diff --git a/actionpack/lib/abstract_controller/helpers.rb b/actionpack/lib/abstract_controller/helpers.rb index 77cc4c07d9..4e0672d590 100644 --- a/actionpack/lib/abstract_controller/helpers.rb +++ b/actionpack/lib/abstract_controller/helpers.rb @@ -49,9 +49,9 @@ module AbstractController meths.each do |meth| _helpers.class_eval <<-ruby_eval, __FILE__, __LINE__ + 1 - def #{meth}(*args, &blk) - controller.send(%(#{meth}), *args, &blk) - end + def #{meth}(*args, &blk) # def current_user(*args, &blk) + controller.send(%(#{meth}), *args, &blk) # controller.send(:current_user, *args, &blk) + end # end ruby_eval end end |