Tag Archives: ActiveRecord

Usage of Keyword as model/association in Rails

A quick note –

Attribute is a reserved key work so use it with caution.

Do not have any model, associations named as attribute.

It typically gives an error like this-

undefined method `keys’ for #<ActiveRecord::Relation:….

So in case you come across such an error, before debugging further, just do a quick check if the name is a reserved word in Rails.