diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2012-09-07 05:13:42 -0700 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2012-09-07 05:13:42 -0700 |
commit | c5ac6da5c213d61acc8a3552cf58a224be92ba53 (patch) | |
tree | e9c074fc4a993978e8ba31ce4b47843f41b0549c /actionpack | |
parent | e20a790b9e63ff7ff71753b24bd88c0a62dc2cf7 (diff) | |
parent | 6777f7b75d1d10ff148e3d72cef3ef642de5bda3 (diff) | |
download | rails-c5ac6da5c213d61acc8a3552cf58a224be92ba53.tar.gz rails-c5ac6da5c213d61acc8a3552cf58a224be92ba53.tar.bz2 rails-c5ac6da5c213d61acc8a3552cf58a224be92ba53.zip |
Merge pull request #7560 from bogdan/deprecate_callbacks_monkeypatch
AS::Callbacks: deprecate monkey patch of object callbacks
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/caching/actions.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/filters_test.rb | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/caching/actions.rb b/actionpack/lib/action_controller/caching/actions.rb index 0238135bc1..eb3aa05a25 100644 --- a/actionpack/lib/action_controller/caching/actions.rb +++ b/actionpack/lib/action_controller/caching/actions.rb @@ -132,7 +132,7 @@ module ActionController #:nodoc: options.values_at(:cache_path, :store_options, :layout) end - def filter(controller) + def around(controller) cache_layout = @cache_layout.respond_to?(:call) ? @cache_layout.call(controller) : @cache_layout path_options = if @cache_path.respond_to?(:call) diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index afc00a3c9d..d203601771 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -193,7 +193,7 @@ class FilterTest < ActionController::TestCase end class ConditionalClassFilter - def self.filter(controller) controller.instance_variable_set(:"@ran_class_filter", true) end + def self.before(controller) controller.instance_variable_set(:"@ran_class_filter", true) end end class OnlyConditionClassController < ConditionalFilterController @@ -309,7 +309,7 @@ class FilterTest < ActionController::TestCase end class AuditFilter - def self.filter(controller) + def self.before(controller) controller.instance_variable_set(:"@was_audited", true) end end @@ -449,7 +449,7 @@ class FilterTest < ActionController::TestCase class ErrorToRescue < Exception; end class RescuingAroundFilterWithBlock - def filter(controller) + def around(controller) begin yield rescue ErrorToRescue => ex @@ -894,7 +894,7 @@ end class ControllerWithFilterClass < PostsController class YieldingFilter < DefaultFilter - def self.filter(controller) + def self.around(controller) yield raise After end @@ -905,7 +905,7 @@ end class ControllerWithFilterInstance < PostsController class YieldingFilter < DefaultFilter - def filter(controller) + def around(controller) yield raise After end @@ -916,13 +916,13 @@ end class ControllerWithFilterMethod < PostsController class YieldingFilter < DefaultFilter - def filter(controller) + def around(controller) yield raise After end end - around_filter YieldingFilter.new.method(:filter), :only => :raises_after + around_filter YieldingFilter.new.method(:around), :only => :raises_after end class ControllerWithProcFilter < PostsController |