
Untitled
By: a guest on
May 2nd, 2012 | syntax:
None | size: 0.49 KB | hits: 12 | expires: Never
## Model
class ContainerCharge < ShipmentCharge
belongs_to :container
end
class Container < ActiveRecord::Base
has_many :container_charges
end
class HandlingContainerCharge < ContainerCharge
end
class ShippingContainerCharge < ContainerCharge
end
## Controller
#Please assume here that this container has many Handling and Shipping charges
container.container_charges # <- doesn't return the handling and shipping charges,
#only instances of the the super class ContainerCharge