palkan / action_policy

Authorization framework for Ruby/Rails applications
https://actionpolicy.evilmartians.io
MIT License
1.39k stars 90 forks source link

undefined method `executor' #19

Closed brendon closed 6 years ago

brendon commented 6 years ago

Tell us about your environment

Ruby Version: ruby 2.3.6p384 (2017-12-14 revision 61254) [x86_64-darwin17]

Framework Version (Rails, whatever): Rails 4.2.10

Action Policy Version: action_policy (0.2.0)

What did you do?

Trying to boot the application after installing action_policy.

What did you expect to happen?

The application starts.

What actually happened?

The application crashes:

XYZ[80286]: bundler: failed to load command: puma (/Users/brendon/.rbenv/versions/2.3.6/bin/puma)
XYZ[80286]: NoMethodError: undefined method `executor' for #< XYZ::Application:0x00007f80f2ecfd40>
XYZ[80286]:   /Users/brendon/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/action_policy-0.2.0/lib/action_policy/railtie.rb:48:in `block in <class:Railtie>'

Is action_policy compatible with Rails 4.2? :)

brendon commented 6 years ago

executor isn't part of Rails 4.2 but your test matrix must somehow not be testing that codepath. Is it because I'm using pumadev and that's hooking into clear_per_thread_cache?

https://github.com/palkan/action_policy/blob/master/lib/action_policy/railtie.rb#L47

palkan commented 6 years ago

executor isn't part of Rails 4.2 but your test matrix must somehow not be testing that codepath

Unfortunately, we do not have integration tests for Railtie(

Definitely a bug.

brendon commented 6 years ago

Thanks @palkan :) I'm super keen to get started with action_policy and retire my old hand-written authorisation code! I'll see if there's a workaround in the meantime :)