guunnn
guunnn

Reputation: 31

how to skip before_action from alchemy-devise user controller and user session controller? Rails

I have a project that is using alchemy cms and alchemy-devise gem. The gem has a method executed in the controllers of the gem as a before_action How can I skip this method from being executed directly from the gem?

https://github.com/magiclabs/alchemy-devise/blob/master/app/controllers/alchemy/users_controller.rb

line 6 and block on line 40

this code comes directly from the gem, how can i stop it from been executed?

Upvotes: 0

Views: 194

Answers (1)

Robin
Robin

Reputation: 915

You want to prevent the user from being redirected to the dashboard, right?

I don't know why you want to do that, but to answer the question you could do following (untested):

# config/application.rb
module YourApp
  class Application < Rails::Application
    # ...
    config.to_prepare do
      Alchemy::UsersController.skip_before_action :check_user_count
    end
  end
end

For my interest: Why do you want that?

Upvotes: 0

Related Questions