I`m using the joing model Part to access Treinando from Evento.
This code works well:

   @treinandos = Evento.find(params[:evento_id]).treinandos

But the parts table has some more columns I need to retrieve
addtionally.
Even after some docs/googling and tests I was not able to append this
information to the resulting object @treinandos.

Can you give some hints about how to do it?

Models:

class Treinando < ActiveRecord::Base
  has_many :parts
  has_many :eventos, :through => :parts
end
class Part < ActiveRecord::Base
  belongs_to :treinando
  belongs_to :evento
end
class Evento < ActiveRecord::Base
  has_many :parts
  has_many :treinandos, :through => :parts
end


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to