rails / protected_attributes

Protect attributes from mass-assignment in ActiveRecord models.
MIT License
228 stars 92 forks source link

Don't pollute toplevel with active_record_40? method #92

Closed amatsuda closed 7 years ago

amatsuda commented 7 years ago

Since active_record_40? method for this plugin internal use is defined on toplevel, this method can actually be called from anywhere in our apps.

e.g.

% rails r "p active_record_40?"
false

This situation can be improved by moving the method under ActiveRecord module, or maybe elegantly by using refinements, but I just copied the whole logic 5 times here and there in the gem, because it's just a single line of straight forward Ruby code.