Thanks for the answer, let me add a little color as to what I'm trying
to get working:
I have the following models: Users (id, name, email, instance_id,
etc...) Instances (id, domain name) Books (id, name, user_id,
In Rails 3, When a new book is created, I need the user_id, and
instance_id to be populated based on the current_user.
Currently, user_id is being assigned when I create a new book but not
class Instance < ActiveRecord::Base
has_many :books, :through => :users, :order => "created_at DESC"
class User < ActiveRecord::Base
has_many :books, :order => "created_at DESC"
class Book < ActiveRecord::Base
has_one :instance, :through => :user
Thoughts on this? I'm a newbie so I'd love to hear if I going down the
right track or not...
And I like your first suggestion assuming you like the models above: