Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined method hide_action - using Rails 5 #221

Open
tomkadwill opened this issue Jan 23, 2017 · 5 comments
Open

Undefined method hide_action - using Rails 5 #221

tomkadwill opened this issue Jan 23, 2017 · 5 comments

Comments

@tomkadwill
Copy link

I'm using Rails 5. After I install the gem and run rails g authorization:install I get the following error:

/Users/blahblah/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:94:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'declarative_authorization'.
Gem Load Error is: undefined method `hide_action' for ActionController::Base:Class
Backtrace for gem load error is:
/Users/blahblah/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/declarative_authorization-0.5.7/lib/declarative_authorization/in_controller.rb:9:in `included'
/Users/blahblah/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/declarative_authorization-0.5.7/lib/declarative_authorization.rb:16:in `include'
/Users/blahblah/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/declarative_authorization-0.5.7/lib/declarative_authorization.rb:16:in `<top (required)>'
/Users/blahblah/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:in `require'
/Users/blahblah/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
/Users/blahblah/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `each'
/Users/blahblah/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `block in require'
/Users/blahblah/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `each'
/Users/blahblah/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `require'
/Users/blahblah/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler.rb:106:in `require'

Let me know if this is something that the maintainers want to fix - I would be happy to help with this.

@zeiv
Copy link
Contributor

zeiv commented Jan 26, 2017

Hey @tomkadwill, if you're interested, I've been working on a gem designed to be a drop-in Rails 5 replacement for Declarative Authorization called Authoreyes. It uses the exact same authorization rules DSL syntax. I'm using it comfortably in a production/professional app right now despite the warnings in the README (which probably should be updated).

I'm not sure how the rest of the community feels about it, but I would love to have some Decl Auth users try it out and provide feedback or contributions.

@tomkadwill
Copy link
Author

Thanks @zeiv, I'll give it a try :)

@dvicory
Copy link

dvicory commented May 8, 2019

@tomkadwill I know it's been awhile, but for you or people in the future who find this, I'd recommend our fork of declarative_authorization. ae_declarative_authorization adds Rails 5 support, among many other improvements, and we're actively maintaining it since it's a huge part of our app.

@dabizlja
Copy link

our

@dvicory is there any documentation for upgrading from declarative_authorization to your fork? Or everything will continue to work the same there is nothing specific to be changed/added after switching over to your fork?
Thanks

@dvicory
Copy link

dvicory commented Jun 25, 2020

@dvicory is there any documentation for upgrading from declarative_authorization to your fork? Or everything will continue to work the same there is nothing specific to be changed/added after switching over to your fork?
Thanks

@dabizlja, there's no explicit documentation on how to do it. What I can say is our internal change from our monkey patched declarative_authorization (mostly optimizations) to ae_declarative_authorization was very easy. ae_declarative_authorization started life from another person's fork of this repo, then we applied our optimization monkey patches. Even with all that history to the gem, we still didn't have to make changes beyond switching requires and the dependency.

Since the first release, we've continued to add support for more things like Rails 6 and Grape. I know each of these changes were done with an eye towards backwards compatibility to minimize our internal burden of upgrading since we use it extensively. I don't think I can guarantee drop-in compatibility for later releases, but I find it likely the upgrade would be painless and likely consist of simply changing the dependency and perhaps a few requires, as the major API surface shouldn't have changed.

One big thing I know we included was the removal of the rules browser (looking at the old issue now it seems it may have not worked anyway).

Please try it out and if there's something interesting about your upgrade process, please do let us know with a new issue in ae_declarative_authorization so that we could add or fix documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants