#747 ✓resolved
Chuck Benedict

Adding :conditions to has_many relationship causes aside to vanish

Reported by Chuck Benedict | June 28th, 2010 @ 11:07 PM | in Hobo 1.3 (Rails 3)

I am using hobo 1.0.1.

I have the following declared in a model called 'Client':

     has_many :applied_categories, 
       :through => :client_categories, 
       :accessible => true, 
       :class_name => 'Category',
       :conditions => ['categories.parent_id is null'],
       :after_add => :add_global_deliverables_for_category

I have the following declared in the client_hints.rb file:

     children :client_deliverables, :applied_categories

With the :conditions parameter on the has_many definition, my applied_categories side bar disappears. When I remove it, it reappears. I have confirmed via the console for my test that with the condition present, I still have a row present in the associated collection.

When I look at the generated pages.dryml code, I can see that within the aside tags for the page, the collection definition is missing when the :conditions parameter is present.

Comments and changes to this ticket

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages