Marco Lazzeri
2006-Jul-31 12:50 UTC
[Rails] Polymorphic has_many association through a belongs_to
Hi, Let''s say I''ve the following Models and their relative associations: Seat ---- belongs_to :booking Booking ------- has_many :seats has_many :debits, :as => :chargeable Debits ------ belongs_to :chargeable, :polymorphic => true Why >> seat.booking.debits nil while >> Booking.find(seat.booking_id).debits [] ? Thanks. Cheers, Marco -- Posted via http://www.ruby-forum.com/.
Maybe Matching Threads
- [PATCH] Polymorphic belongs_to association with :conditions issues
- Naming rights_roles join model using has_many :through and polymorphic associations
- Multiple polymorphic belongs_to declarations
- accepts_nested_attributes + polymorphic association
- polymorphic association with single model as target