I have a method that looks like this:
Rating Load (4.5ms) SELECT "ratings".* FROM "ratings" WHERE "ratings"."profile_id" = $1 AND "ratings"."user_id" = 7 LIMIT $2 [["profile_id", 12], ["LIMIT", 1]]
NoMethodError: undefined method `rating' for #<Rating:0x007fca0c4fba90>
If you're looking to access a property on an ActiveRecord model they provide a simple accessor:
This is safer than the
send method since it's only going to fetch attributes. If you had a method called
ban_and_charge_ten_bucks! some hostile user might be able your system into calling that if you call
send without checking what you're calling.