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
Belongs to collapse
Has many collapse
- #exported_catalog_item_images ⇒ ActiveRecord::Relation<ExportedCatalogItemImage>
- #exported_catalog_item_literatures ⇒ ActiveRecord::Relation<ExportedCatalogItemLiterature>
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
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation
Methods included from Models::EventPublishable
Instance Method Details
#catalog_item ⇒ CatalogItem
18 |
# File 'app/models/exported_catalog_item.rb', line 18 belongs_to :catalog_item |
#exported_catalog_item_images ⇒ ActiveRecord::Relation<ExportedCatalogItemImage>
20 |
# File 'app/models/exported_catalog_item.rb', line 20 has_many :exported_catalog_item_images, inverse_of: :exported_catalog_item |
#exported_catalog_item_literatures ⇒ ActiveRecord::Relation<ExportedCatalogItemLiterature>
21 |
# File 'app/models/exported_catalog_item.rb', line 21 has_many :exported_catalog_item_literatures |
#exported_catalog_item_packet ⇒ ExportedCatalogItemPacket
17 |
# File 'app/models/exported_catalog_item.rb', line 17 belongs_to :exported_catalog_item_packet |
#image_attributes ⇒ Object
29 30 31 |
# File 'app/models/exported_catalog_item.rb', line 29 def image_attributes exported_catalog_item_packet.exported_catalog_item_packet_image_attributes.where(selected: true) end |
#item ⇒ Object
Alias for Catalog_item#item
27 |
# File 'app/models/exported_catalog_item.rb', line 27 delegate :item, to: :catalog_item, allow_nil: true |
#product_specifications ⇒ ActiveRecord::Relation<ProductSpecification>
24 |
# File 'app/models/exported_catalog_item.rb', line 24 has_and_belongs_to_many :product_specifications |
#publications ⇒ ActiveRecord::Relation<Item>
23 |
# File 'app/models/exported_catalog_item.rb', line 23 has_and_belongs_to_many :publications, class_name: 'Item' |
#publications_for_select ⇒ Object
33 34 35 |
# File 'app/models/exported_catalog_item.rb', line 33 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
26 |
# File 'app/models/exported_catalog_item.rb', line 26 delegate :sku, to: :catalog_item, allow_nil: true |