Skip to content

Commit

Permalink
Prevent deprecation warning in Rails 5.0 (jaredonline#33)
Browse files Browse the repository at this point in the history
* Use prepend_before_action if available.

{prepend_,}{before,after}_filter are deprecated in Rails 5.0
and will be removed in Rails 5.1.

* add dependency rake ~> 11.0 for tests
  • Loading branch information
Tietew authored and jaredonline committed Dec 16, 2016
1 parent b655976 commit 3541b33
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ spec/reports
test/tmp
test/version_tmp
tmp
vendor
1 change: 1 addition & 0 deletions google-authenticator.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Gem::Specification.new do |gem|
gem.add_dependency "google-qr"
gem.add_dependency "actionpack"

gem.add_development_dependency "rake", "~> 11.0"
gem.add_development_dependency "rspec", "~> 2.8.0"
gem.add_development_dependency "appraisal", "~> 0.5.1"
gem.add_development_dependency "sqlite3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ module Integration
def self.included(klass)
raise RailsAdapter::LoadedTooLateError.new if defined?(::ApplicationController)

klass.prepend_before_filter(:activate_google_authenticator_rails)
method = klass.respond_to?(:prepend_before_action) ? :prepend_before_action : :prepend_before_filter
klass.send(method, :activate_google_authenticator_rails)
end

private
Expand Down

0 comments on commit 3541b33

Please sign in to comment.