Closed Burgestrand closed 2 years ago
I think I'm missing something: wasn't this a bugfix?
In the previous implementation, we were effectively doing policy = policy(record)
and then calling policy.public_send(query)
.
The issue with that is that policy(record)
returns nil
in the situation where there's no policy class corresponding to the record, so we'd get eg. NoMethodError: index? is not defined on nil
?
@adherr What's the behaviour from the previous implementation that you're relying on?
Good point! I missed that. I'll close this in the interim and we'll reopen it when there's new information.
_Originally posted by @adherr in https://github.com/varvet/pundit/pull/697#discussion_r835656389_