It looks like the object you named .id on is not really an ActiveRecord model. You should see this warning only for Ruby objects, where .id is soon an obsolete version of Object#object_id .
However, another way to access the primary key for an ActiveRecord model field is model.attributes['id'] so you can try this.
mikej source share