inossidabile / protector

Comfortable (seriously) white-list security restrictions for models on a field level
MIT License
270 stars 31 forks source link

Define AR callback as method for Rails 4.1 compatibility #38

Closed kamui closed 10 years ago

kamui commented 10 years ago

Rails 4.1 no longer allows you to return from an inline callback block, it's recommended you define the callback as a method.

https://github.com/rails/rails/issues/12981

This was causing me issues when trying to destroy an instance of a model with a protect block defined.

inossidabile commented 10 years ago

Could you please rename the method to protector_ensure_destroyable

kamui commented 10 years ago

Done. If you decide to merge this, would you consider releasing a new version with it?

inossidabile commented 10 years ago

0.7.3 released. Thank you :+1: