Skip to content

Commit ff31697

Browse files
webhoernchensikachu
authored andcommitted
Rails 5 support (#7)
1 parent 57c7570 commit ff31697

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Diff for: lib/action_controller/verification.rb

+12-1
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,21 @@ module ClassMethods
7979
# do not apply this verification to the actions specified in the associated
8080
# array (may also be a single value).
8181
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
8383
verify_action options
8484
end
8585
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
8697
end
8798

8899
private

Diff for: verification.gemspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Gem::Specification.new do |s|
1515
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
1616
s.require_paths = ["lib"]
1717

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')
2020

2121
s.add_development_dependency('rake')
2222
s.add_development_dependency('appraisal')

0 commit comments

Comments
 (0)