I want to be able to query user.items and item.owner, in code:
class Item < ActiveRecord::Base
has_one :owner, :class_name => "User"
end
class User < ActiveRecord::Base
# What goes here?
has_many :items
end
I added to the Item model a column owner_id, how do I construct the User model so it uses owner_id instead of user_id when I call user.items?