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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs