Class: ExportedCatalogItem
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ExportedCatalogItem
- Defined in:
- app/models/exported_catalog_item.rb
Overview
== Schema Information
Table name: exported_catalog_items
Database name: primary
id :integer not null, primary key
created_at :datetime not null
updated_at :datetime not null
catalog_item_id :integer
exported_catalog_item_packet_id :integer
Indexes
idx_exported_catalog_items_unique (exported_catalog_item_packet_id,catalog_item_id) UNIQUE
Constant Summary
Constants included from Models::Schedulable
Models::Schedulable::SIMPLE_FORM_OPTIONS
Belongs to collapse
Has many collapse
Has and belongs to many collapse
- #product_specifications ⇒ ActiveRecord::Relation<ProductSpecification>
- #publications ⇒ ActiveRecord::Relation<Item>
Delegated Instance Attributes collapse
-
#item ⇒ Object
Alias for Catalog_item#item.
-
#sku ⇒ Object
Alias for Catalog_item#sku.
Instance Method Summary collapse
- #image_attributes ⇒ ActiveRecord::Relation<ExportedCatalogItemPacketImageAttribute>
- #publications_for_select ⇒ Array<Array(String, Integer)>
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation
Methods included from Models::Schedulable
Methods included from Models::AfterCommittable
Methods included from Models::EventPublishable
Instance Method Details
#catalog_item ⇒ CatalogItem
21 |
# File 'app/models/exported_catalog_item.rb', line 21 belongs_to :catalog_item |
#exported_catalog_item_images ⇒ ActiveRecord::Relation<ExportedCatalogItemImage>
24 |
# File 'app/models/exported_catalog_item.rb', line 24 has_many :exported_catalog_item_images, inverse_of: :exported_catalog_item |
#exported_catalog_item_packet ⇒ ExportedCatalogItemPacket
19 |
# File 'app/models/exported_catalog_item.rb', line 19 belongs_to :exported_catalog_item_packet |
#image_attributes ⇒ ActiveRecord::Relation<ExportedCatalogItemPacketImageAttribute>
35 36 37 |
# File 'app/models/exported_catalog_item.rb', line 35 def image_attributes exported_catalog_item_packet.exported_catalog_item_packet_image_attributes.where(selected: true) end |
#item ⇒ Object
Alias for Catalog_item#item
32 |
# File 'app/models/exported_catalog_item.rb', line 32 delegate :item, to: :catalog_item, allow_nil: true |
#product_specifications ⇒ ActiveRecord::Relation<ProductSpecification>
29 |
# File 'app/models/exported_catalog_item.rb', line 29 has_and_belongs_to_many :product_specifications |
#publications ⇒ ActiveRecord::Relation<Item>
27 |
# File 'app/models/exported_catalog_item.rb', line 27 has_and_belongs_to_many :publications, class_name: 'Item' |
#publications_for_select ⇒ Array<Array(String, Integer)>
40 41 42 |
# File 'app/models/exported_catalog_item.rb', line 40 def publications_for_select catalog_item.item.all_my_publications.map { |p| [p.name, p.id] }.sort_by { |o| o.first.upcase } end |
#sku ⇒ Object
Alias for Catalog_item#sku
31 |
# File 'app/models/exported_catalog_item.rb', line 31 delegate :sku, to: :catalog_item, allow_nil: true |