I am using Rails 2.3.5.
Class User < ActiveRecord::Base
has_many :phones
end
class Phone < ActiveRecord::Base
has_many :frequency_bands
end
I want to get all frequencies_bent for the user. I know that I can write a def freq_bands method for a User, but I would like to know if it is possible to have has_many freq_bands for a User. That way I can bind the call.
What I would like to have is
class User < ActiveRecor::Base
has_many :frequence_bands, :through => phones
end
I think it is possible to use the nested has_many with this plugin http://github.com/ianwhite/nested_has_many_through
However, if possible, I would like to avoid using another plugin and rely solely on the rails.
source
share