[Rails] Re: Select and inner join

2013-02-17 Thread Lorenz Blackbird
@p_ids = @course.paragraph_ids This solution works fine! Too simple for a C programmer like me :) Pluck gave me the same MySQL error. Thanks at all for the help. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on R

[Rails] Re: Select and inner join

2013-02-15 Thread Lorenz Blackbird
Colin Law wrote in post #1097096: >> Paragraph.joins(:course_paragraphs => :course) >> .where('course_paragraphs.course_id' => @course.id) > > You don't need to do that. If you have a course in @course then its > paragraphs are just @course.paragraphs. It is rare to have to use > joins w