Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Breaks has_one :through

#2

I have some code like this. Your most excellent plug-in makes the third line possible, but then introduces an error in the 2nd line which works fine without the plug-in. The error looks like what you see in the 3rd line without the plug-in (unknown column...)

I changed the domain terms to make this more familiar, hopefully you can see what I mean from this.

@@@ruby has_many :tasks, :through => :projects has_one :primary_task, :through => :projects, :source => :tasks, :conditions => 'tasks.primary = true' has_many :task_items, :through => :tasks


Reported by Jeremy Huffman · February 4th, 2009 @ 01:50 AM

State: open
Milestone: none
Assigned to: Ian White Ian White

Activity

  1. Jeremy Huffman
    Jeremy Huffman

    retry formatting failure...

    has_many :tasks, :through => :projects has_one :primary_task, :through => :projects, :source => :tasks, :conditions => 'tasks.primary = true' has_many :task_items, :through => :tasks

    February 4th, 2009 @ 01:53 AM

  2. Jeremy Huffman
    Jeremy Huffman

    last try...

    has_many :tasks, :through => :projects

    has_one :primary_task, :through => :projects, :source => :tasks, :conditions => 'tasks.primary = true'

    has_many :task_items, :through => :tasks

    February 4th, 2009 @ 01:54 AM

  3. Ian White
    Ian White
    • State changed from new to open

    That sounds bad! thanks for the report, what rails version etc?

    Any chance of forking and adding a failing spec, to get things going?

    February 4th, 2009 @ 04:35 PM

  4. jopotts
    jopotts

    I've just run into the same problem as Jeremy.

    Has anyone looked into this yet?

    April 20th, 2009 @ 06:29 PM

  5. Matt Scilipoti
    Matt Scilipoti

    It looks like janmejay answered it in Sept. 2008: http://github.com/janmejay/nested_has_many_through/tree/master.

    Since JackDanger forked janmejay AND has commits for rails 2.3, I changed my plugin to use his: git://github.com/JackDanger/nested_has_many_through.git. This one is working fine for me.

    Hope this helps.

    July 30th, 2009 @ 06:29 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.