Class: ShipmentContent
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ShipmentContent
- Defined in:
- app/models/shipment_content.rb
Overview
== Schema Information
Table name: shipment_contents
Database name: primary
id :integer not null, primary key
quantity :integer
line_item_id :integer not null
shipment_id :integer not null
Indexes
idx_line_item_shipment (line_item_id,shipment_id)
index_shipment_contents_on_shipment_id (shipment_id)
Foreign Keys
fk_rails_... (line_item_id => line_items.id) ON DELETE => cascade
fk_rails_... (shipment_id => shipments.id) ON DELETE => cascade
Belongs to collapse
Class Method Summary collapse
-
.from_completed_shipments ⇒ ActiveRecord::Relation<ShipmentContent>
A relation of ShipmentContents that are from completed shipments.
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation
Methods included from Models::EventPublishable
Class Method Details
.from_completed_shipments ⇒ ActiveRecord::Relation<ShipmentContent>
A relation of ShipmentContents that are from completed shipments. Active Record Scope
28 |
# File 'app/models/shipment_content.rb', line 28 scope :from_completed_shipments, -> { joins(:shipment).merge(Shipment.completed) } |