Reputation: 8755
I want to know if there is a best to name model attribute that won't conflict with ActiveRecord::Base
instance methods.
For example, we probably won't name attribute as class
or toggle
, since these names have already been taken. But how do I simply know if the name is conflicted when generating a model? Any ideas?
Upvotes: 0
Views: 204
Reputation: 24815
Fire your console at first
> a = MyModel.new
> a.methods.grep(/my_attr/)
If nothing, nice, you can use my_attr
Upvotes: 3