devise_invitable icon indicating copy to clipboard operation
devise_invitable copied to clipboard

fixing nil reference in invitations_controller.rb

Open maxhodak opened this issue 11 years ago • 2 comments

Using devise_invitable 1.3.4 I get a "cannot access invitation_token on nilObject" in invitations_controller.rb which came down to resource being lost from the relevant before_filter. Changing the resource assignment there to use a direct reference (@) fixes this though adds two extra lines (setting back to self.resource in the controller methods to keep compatibility with views and other things).

Obviously this code works for other people so I'm not sure why it's so broken for me; this is something that to me looks like it never should have worked. I'm confident I don't have anything else in a filter chain that could be overwriting or resetting self.resource. Thoughts?

maxhodak avatar Apr 04 '14 13:04 maxhodak

I don't think the Travis error here was related to my commit, see: https://travis-ci.org/scambra/devise_invitable/jobs/22266880

maxhodak avatar Apr 04 '14 20:04 maxhodak

Bug fixes need a test case failing, can you write one?

scambra avatar Apr 07 '14 06:04 scambra