Hello,

In User model:
  has_many :projects, :through => :authorizations

In view:
  render :partial => @user.projects

This blows up because HasManyThroughAssociation inherits from
AssociationProxy and not AssociationCollection.

Partial logic checks if @user.projects === AssociationCollection which
returns false.

Quick workaround is: render :partial => @user.projects.to_a

(actionpack/lib/action_view/partials.rb rev8129 line 122):

 def render_partial(partial_path, object_assigns = nil, local_assigns
= nil) #:nodoc:
        case partial_path
...
        when Array, ActiveRecord::Associations::AssociationCollection
...

Should it be changed to "when Array,
ActiveRecord::Associations::AssociationProxy" or
HasManyThroughAssociation should inherit from AssociationCollection?

--
Jacek


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to