Hi there,
I've got a question about best practice/preferred method of setting up an association. I have a User model which has and belongs to many interests.
From playing about with the console I know I can go..
interests = Interests.find([1,2,3,4]) user = User.new(:interests=>interests) ...or... user = User.new(:interest_ids=>[1,2,3,4,5])
and similarly on existing objects
user.interest_ids = [1,2,3,4] or user.interests = [interest_obj_a, interest_obj_b, interest_obj_c)
My question is, is there a functional difference between the two, or can one freely interchange between setting relations via id or via literal objects?
Thanks,
Gavin.