1- require 'active_support/deprecation'
2-
31module AbstractController
42 module Callbacks
53 extend ActiveSupport ::Concern
@@ -56,11 +54,7 @@ def skip_action_callback(*names)
5654 skip_after_action ( *names )
5755 skip_around_action ( *names )
5856 end
59-
60- def skip_filter ( *names )
61- ActiveSupport ::Deprecation . warn ( "#{ callback } _filter is deprecated and will removed in Rails 5. Use #{ callback } _action instead." )
62- skip_action_callback ( *names )
63- end
57+ alias_method :skip_filter , :skip_action_callback
6458
6559 # Take callback names and an optional callback proc, normalize them,
6660 # then call the block with each callback. This allows us to abstract
@@ -175,22 +169,14 @@ def _insert_callbacks(callbacks, block = nil)
175169 set_callback ( :process_action , callback , name , options )
176170 end
177171 end
178-
179- define_method "#{ callback } _filter" do |*names , &blk |
180- ActiveSupport ::Deprecation . warn ( "#{ callback } _filter is deprecated and will removed in Rails 5. Use #{ callback } _action instead." )
181- send ( "#{ callback } _action" , *names , &blk )
182- end
172+ alias_method :"#{ callback } _filter" , :"#{ callback } _action"
183173
184174 define_method "prepend_#{ callback } _action" do |*names , &blk |
185175 _insert_callbacks ( names , blk ) do |name , options |
186176 set_callback ( :process_action , callback , name , options . merge ( :prepend => true ) )
187177 end
188178 end
189-
190- define_method "prepend_#{ callback } _filter" do |*names , &blk |
191- ActiveSupport ::Deprecation . warn ( "prepend_#{ callback } _filter is deprecated and will removed in Rails 5. Use prepend_#{ callback } _action instead." )
192- send ( "prepend_#{ callback } _action" , *names , &blk )
193- end
179+ alias_method :"prepend_#{ callback } _filter" , :"prepend_#{ callback } _action"
194180
195181 # Skip a before, after or around callback. See _insert_callbacks
196182 # for details on the allowed parameters.
@@ -199,18 +185,11 @@ def _insert_callbacks(callbacks, block = nil)
199185 skip_callback ( :process_action , callback , name , options )
200186 end
201187 end
202-
203- define_method "skip_#{ callback } _filter" do |*names , &blk |
204- ActiveSupport ::Deprecation . warn ( "skip_#{ callback } _filter is deprecated and will removed in Rails 5. Use skip_#{ callback } _action instead." )
205- send ( "skip_#{ callback } _action" , *names , &blk )
206- end
188+ alias_method :"skip_#{ callback } _filter" , :"skip_#{ callback } _action"
207189
208190 # *_action is the same as append_*_action
209- alias_method :"append_#{ callback } _action" , :"#{ callback } _action" # alias_method :append_before_action, :before_action
210- define_method "append_#{ callback } _filter" do |*names , &blk |
211- ActiveSupport ::Deprecation . warn ( "append_#{ callback } _filter is deprecated and will removed in Rails 5. Use append_#{ callback } _action instead." )
212- send ( "append_#{ callback } _action" , *names , &blk )
213- end
191+ alias_method :"append_#{ callback } _action" , :"#{ callback } _action"
192+ alias_method :"append_#{ callback } _filter" , :"#{ callback } _action"
214193 end
215194 end
216195 end
0 commit comments