I've run into a problem with has_one :through and additional  
attributes on the 'through' model.

Tests and further description at:
http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1376

Thanks,

--Matt Jones

---
Ticket summary:

The attached patch is several failing tests that show a problem with  
using has_one :through with a decorated model.

Models are:

# simplified for readability - see full model in source
class Member < ActiveRecord::Base
has_one :member_detail
   has_one :organization, :through => :member_detail
end

class MemberDetail < ActiveRecord::Base
   # has additional string field 'extra_data'
   belongs_to :member
   belongs_to :organization
end

class Organization < ActiveRecord::Base
   has_many :member_details
   has_many :members, :through => :member_details
end
The problem appears when you create a member, add a member_detail to  
it, and then add it to an organization. Either two MemberDetails get  
created, or one is created without the extra_data field set correctly.

--~--~---------~--~----~------------~-------~--~----~
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