Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Sanction with STI Children interrupt Rails boot #3

Closed
pjleonhardt opened this Issue · 1 comment

2 participants

@pjleonhardt
Collaborator

If you have more than one child class from the same parent in your permissionables array, the hook for adding the "total" method will break on the second child..

See commit f29c2ce for example breaking config.

Error Backtrace:

1) Error:
test_any(SanctionTest): 
NameError: (eval):2:in `remove_method': method `total' not defined in Class
/home/pjleonhardt/projects/rails/plugins/sanction/lib/sanction/extensions/total.rb:8:in `included'
(eval):2:in `send'
(eval):2:in `included'
/home/pjleonhardt/projects/rails/plugins/sanction/lib/sanction/permissionable.rb:14:in `include'
/home/pjleonhardt/projects/rails/plugins/sanction/lib/sanction/permissionable.rb:14:in `send'
/home/pjleonhardt/projects/rails/plugins/sanction/lib/sanction/permissionable.rb:14:in `included'
/home/pjleonhardt/projects/rails/plugins/sanction/lib/sanction.rb:82:in `include'
/home/pjleonhardt/projects/rails/plugins/sanction/lib/sanction.rb:82:in `send'
/home/pjleonhardt/projects/rails/plugins/sanction/lib/sanction.rb:82:in `inject_permissionables!'
/home/pjleonhardt/projects/rails/plugins/sanction/lib/sanction.rb:81:in `each'
/home/pjleonhardt/projects/rails/plugins/sanction/lib/sanction.rb:81:in `inject_permissionables!'
/home/pjleonhardt/projects/rails/plugins/sanction/lib/sanction.rb:71:in `do_injections!'
/home/pjleonhardt/projects/rails/plugins/sanction/lib/sanction.rb:19:in `configure'
/test/unit/sanction_test.rb:9:in `setup'
@matthewvermaak

Fix @ 95b891b

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.