Browse Source

Merge pull request #79 from tenstartups/master

Removed Rails 5 deprecation warnings
master
Dmitrii Golub 9 years ago
parent
commit
6245f9d07c
  1. 9
      app/controllers/devise/two_factor_authentication_controller.rb
  2. 6
      lib/two_factor_authentication/controllers/helpers.rb
  3. 6
      spec/rails_app/app/controllers/home_controller.rb

9
app/controllers/devise/two_factor_authentication_controller.rb

@ -1,6 +1,11 @@
class Devise::TwoFactorAuthenticationController < DeviseController class Devise::TwoFactorAuthenticationController < DeviseController
prepend_before_filter :authenticate_scope! if Rails::VERSION::MAJOR >= 4
before_filter :prepare_and_validate, :handle_two_factor_authentication prepend_before_action :authenticate_scope!
before_action :prepare_and_validate, :handle_two_factor_authentication
else
prepend_before_filter :authenticate_scope!
before_filter :prepare_and_validate, :handle_two_factor_authentication
end
def show def show
end end

6
lib/two_factor_authentication/controllers/helpers.rb

@ -4,7 +4,11 @@ module TwoFactorAuthentication
extend ActiveSupport::Concern extend ActiveSupport::Concern
included do included do
before_filter :handle_two_factor_authentication if Rails::VERSION::MAJOR >= 4
before_action :handle_two_factor_authentication
else
before_filter :handle_two_factor_authentication
end
end end
private private

6
spec/rails_app/app/controllers/home_controller.rb

@ -1,5 +1,9 @@
class HomeController < ApplicationController class HomeController < ApplicationController
before_filter :authenticate_user!, only: :dashboard if Rails::VERSION::MAJOR >= 4
before_action :authenticate_user!, only: :dashboard
else
before_filter :authenticate_user!, only: :dashboard
end
def index def index
end end

Loading…
Cancel
Save