I'm wondering to what extent I can use associations in Rails. Take into consideration the following:
class User < ActiveRecord::Base
has_one :provider
has_many :businesses, :through => :provider
end
class Provider < ActiveRecord::Base
has_many :businesses
has_many :bids, :through => :businesses
belongs_to :user
end
class Business < ActiveRecord::Base
has_many :bids
belongs_to :provider
end
class Bid < ActiveRecord::Base
belongs_to :business
end
I am able to set up these nifty shortcuts like User.businesses
and Provider.bids
but what about doing something like User.bids
? Is it possible to associate an association, so to speak?