item_models 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e27ba15bf99b747a66a76cfa35b29db612062a8c03b0377c526a4803cd6538ca
4
- data.tar.gz: f8f4fed63d7125e6a210cbde9c6c4df3e177c28a6fe0db1d77267399d9035d36
3
+ metadata.gz: e3c71347c285a7703860f412a56533fd48f5bfee54937b3db065f8297debd054
4
+ data.tar.gz: 82a0f0634bc58f1cb4d0a5e7278fb10dd65d8c8c7876208b9854cc7c8d9082f7
5
5
  SHA512:
6
- metadata.gz: d09fa132f45c9bb9ccc549236e7adb6a4bb93e33dc97e3ec57cf6df01722ba2f9618a644946b69613b720b5178b9a8e6df12e6216ad24bd4e87573985059207e
7
- data.tar.gz: 1b7999314b02af48bea7e0979ade2ea7b5068f2a3b93287d1d93b48953eafca71e2cf70334d088832ef060212780e5c1f5eddd4479f843e21755d47019e178b5
6
+ metadata.gz: a21edafacd7f8878d97160965758eab907fb38d91e4ed4bb76b011cc846b9f81b2081208e16be80c4a03ca754caaa65b444866ac079fe940dfa8ae61bac3a0b2
7
+ data.tar.gz: b23436b47922eb3cbd7f4fe772752c76a7e6fdd8e60f653fa8bdaabac7b320b9465552e205ca1671d08d133d9a53afdf0eabbb87dea81b8dc52b450ca0d60f52
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ItemModels
4
- VERSION = '0.0.2'
4
+ VERSION = '0.0.3'
5
5
  end
@@ -2,4 +2,8 @@
2
2
 
3
3
  class Bundle < ApplicationRecord
4
4
  self.table_name = 'item_bundles'
5
+
6
+ belongs_to :variant
7
+ belongs_to :item
8
+ has_many :bundle_variants
5
9
  end
@@ -2,4 +2,7 @@
2
2
 
3
3
  class BundleVariant < ApplicationRecord
4
4
  self.table_name = 'item_bundle_variants'
5
+
6
+ belongs_to :bundle
7
+ belongs_to :variant
5
8
  end
@@ -2,4 +2,10 @@
2
2
 
3
3
  class Image < ApplicationRecord
4
4
  self.table_name = 'item_images'
5
+
6
+ belongs_to :item
7
+ has_many :item_listing_images
8
+ has_many :variant_images, foreign_key: :item_image_id
9
+ has_many :master_catalog_images
10
+ has_many :item_listing_variant_custom_fields
5
11
  end
@@ -1,4 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Item < ApplicationRecord
4
+ has_many :variants
5
+ has_many :item_listings
6
+ has_many :bundles
7
+ has_many :images
4
8
  end
@@ -2,4 +2,12 @@
2
2
 
3
3
  class ItemListing < ApplicationRecord
4
4
  self.table_name = 'item_channel_associations'
5
+ belongs_to :item
6
+ has_many :variant_listings, foreign_key: :channel_association_id
7
+ has_many :item_listing_images, foreign_key: :channel_association_id
8
+ has_many :item_listing_categories, foreign_key: :channel_association_id
9
+ has_many :item_listing_brands, foreign_key: :channel_association_id
10
+ has_many :item_listing_variant_custom_fields, foreign_key: :channel_association_id
11
+ has_many :item_listing_custom_fields, foreign_key: :channel_association_id
12
+ has_many :item_listing_variant_images, foreign_key: :channel_association_id
5
13
  end
@@ -2,4 +2,6 @@
2
2
 
3
3
  class ItemListingBrand < ApplicationRecord
4
4
  self.table_name = 'item_channel_association_brands'
5
+
6
+ belongs_to :item_listing, foreign_key: :channel_association_id
5
7
  end
@@ -2,4 +2,6 @@
2
2
 
3
3
  class ItemListingCategory < ApplicationRecord
4
4
  self.table_name = 'item_channel_association_categories'
5
+
6
+ belongs_to :item_listing, foreign_key: :channel_association_id
5
7
  end
@@ -2,4 +2,7 @@
2
2
 
3
3
  class ItemListingCustomField < ApplicationRecord
4
4
  self.table_name = 'item_channel_association_custom_fields'
5
+
6
+ belongs_to :item_listing, foreign_key: :channel_association_id
7
+ belongs_to :variant
5
8
  end
@@ -2,4 +2,6 @@
2
2
 
3
3
  class ItemListingImage < ApplicationRecord
4
4
  self.table_name = 'item_channel_association_images'
5
+ belongs_to :image
6
+ belongs_to :item_listing, foreign_key: :channel_association_id
5
7
  end
@@ -2,4 +2,8 @@
2
2
 
3
3
  class ItemListingVariantCustomField < ApplicationRecord
4
4
  self.table_name = 'item_channel_association_variant_images'
5
+
6
+ belongs_to :item_listing, foreign_key: :channel_association_id
7
+ belongs_to :variant
8
+ belongs_to :image
5
9
  end
@@ -2,4 +2,7 @@
2
2
 
3
3
  class MasterCatalog < ApplicationRecord
4
4
  self.table_name = 'item_variant_master_assocs'
5
+
6
+ belongs_to :variant
7
+ has_many :master_catalog_images, foreign_key: :master_assoc_id
5
8
  end
@@ -2,4 +2,7 @@
2
2
 
3
3
  class MasterCatalogImage < ApplicationRecord
4
4
  self.table_name = 'item_variant_master_image_assocs'
5
+
6
+ belongs_to :master_catalog, foreign_key: :master_assoc_id
7
+ belongs_to :image, foreign_key: :image_id
5
8
  end
@@ -2,4 +2,12 @@
2
2
 
3
3
  class Variant < ApplicationRecord
4
4
  self.table_name = 'item_variants'
5
+ belongs_to :item
6
+ has_many :variant_images, foreign_key: :item_variant_id
7
+ has_many :bundles
8
+ has_many :variant_listings, foreign_key: :variant_id
9
+ has_many :item_listing_variant_images, foreign_key: :variant_id
10
+ has_many :item_listing_variant_custom_field, foreign_key: :variant_id
11
+ has_many :item_listing_custom_field, foreign_key: :variant_id
12
+ has_one :master_catalog, foreign_key: :variant_id
5
13
  end
@@ -2,4 +2,7 @@
2
2
 
3
3
  class VariantImage < ApplicationRecord
4
4
  self.table_name = 'item_variant_images'
5
+
6
+ belongs_to :image
7
+ belongs_to :variant
5
8
  end
@@ -2,4 +2,9 @@
2
2
 
3
3
  class VariantListing < ApplicationRecord
4
4
  self.table_name = 'item_channel_association_variant_associations'
5
+
6
+ belongs_to :variant
7
+ belongs_to :item_listing
8
+ has_many :variant_listing_stock_allocations, foreign_key: :variant_association_id
9
+ has_many :variant_listing_price_histories, foreign_key: :variant_association_id
5
10
  end
@@ -2,4 +2,6 @@
2
2
 
3
3
  class VariantListingPriceHistory < ApplicationRecord
4
4
  self.table_name = 'item_channel_association_variant_association_stock_allocations'
5
+
6
+ belongs_to :variant_listing, foreign_key: :variant_association_id
5
7
  end
@@ -2,4 +2,6 @@
2
2
 
3
3
  class VariantListingStockAllocation < ApplicationRecord
4
4
  self.table_name = 'item_channel_association_variant_association_stock_allocations'
5
+
6
+ belongs_to :variant_listing, foreign_key: :variant_association_id
5
7
  end
@@ -2,4 +2,6 @@
2
2
 
3
3
  class VariantOption < ApplicationRecord
4
4
  self.table_name = 'item_variant_options'
5
+
6
+ has_many :variant_option_associations, foreign_key: :option_id
5
7
  end
@@ -2,4 +2,6 @@
2
2
 
3
3
  class VariantOptionAssociation < ApplicationRecord
4
4
  self.table_name = 'item_variant_option_associations'
5
+
6
+ belongs_to :variant_option, foreign_key: :option_id
5
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: item_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - alexander
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-29 00:00:00.000000000 Z
11
+ date: 2020-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler