-
Notifications
You must be signed in to change notification settings - Fork 903
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
fix PaperTrail::Rails::Controller.included method #351
fix PaperTrail::Rails::Controller.included method #351
Conversation
this bombed if the controller wasn't ActionController::Base and the rails-api gem wasn't included. it seems like there ought to be a better way of doing this in general but this at least prevents the blow up.
So, a scenario where someone is including part of the gem in order to use |
No not that -- A scenario where someone is not using rails-api at all but is including My particular use case is including |
to be clear -- the error I was getting was:
because in this:
the first condition was false and the second condition blew up |
Ohh... I get it. So you don't have I actually was wondering if this statement made the most sense, but it was a quick fix suggested in #313 which seemed to make sense. Just wasn't sure how many other Controller types there might be out there in the wild (clearly more than I was aware of). |
I do have It seems to me that it would make sense just to drop the "if" condition. If you're including |
@batter perhaps could we merge in this PR for now so that things aren't broken? And then consider a better solution after that? |
You may be right, within the gem, it always gets fired off from this hook. In an ideal world, it may not make sense to even load that class (or the |
Do you like this fix better? jordan-brough@d93fe87 I can make a replacement PR out of that instead if so. |
I think that makes more sense, the question is can we rely on the fact that |
Yeah, that's exactly what I was thinking. I opened #352 to replace this PR. |
this bombed if the controller wasn't ActionController::Base and the rails-api gem wasn't included.
it seems like there ought to be a better way of doing this in general but this at least prevents the blow up.