File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -79,10 +79,21 @@ module ClassMethods
79
79
# do not apply this verification to the actions specified in the associated
80
80
# array (may also be a single value).
81
81
def verify ( options = { } )
82
- before_filter :only => options [ :only ] , :except => options [ :except ] do
82
+ before_filter_or_before_action_for_options :only => options [ :only ] , :except => options [ :except ] do
83
83
verify_action options
84
84
end
85
85
end
86
+
87
+ private
88
+ # fix DEPRECATION WARNING:
89
+ # before_filter is deprecated and will be removed in Rails 5.1. Use before_action instead
90
+ def before_filter_or_before_action_for_options ( options , &block )
91
+ if respond_to? :before_action
92
+ before_action options , &block
93
+ else
94
+ before_filter options , &block
95
+ end
96
+ end
86
97
end
87
98
88
99
private
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ Gem::Specification.new do |s|
15
15
s . executables = `git ls-files -- bin/*` . split ( "\n " ) . map { |f | File . basename ( f ) }
16
16
s . require_paths = [ "lib" ]
17
17
18
- s . add_dependency ( 'activesupport' , '>= 3.0.0' , '< 5.0 ' )
19
- s . add_dependency ( 'actionpack' , '>= 3.0.0' , '< 5.0 ' )
18
+ s . add_dependency ( 'activesupport' , '>= 3.0.0' , '< 5.1 ' )
19
+ s . add_dependency ( 'actionpack' , '>= 3.0.0' , '< 5.1 ' )
20
20
21
21
s . add_development_dependency ( 'rake' )
22
22
s . add_development_dependency ( 'appraisal' )
You can’t perform that action at this time.
0 commit comments