Hi, I’m trying to create this method:
has_many :cars do
Car.where(color: ‘red’).all
end
I’m using a class without Activerecord and outside rails:
module API
class User < Base
include ActiveRecord::Associations
has_many :cars do
Car.where(color: ‘red’).all
end
end
end
When I run:
undefined method `dangerous_attribute_method?’
How can I use a has_many and create my own implementation ?
Thanks.