item_models 0.0.3 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3c71347c285a7703860f412a56533fd48f5bfee54937b3db065f8297debd054
4
- data.tar.gz: 82a0f0634bc58f1cb4d0a5e7278fb10dd65d8c8c7876208b9854cc7c8d9082f7
3
+ metadata.gz: 23b9aa22818ac5a25ddd0129cf10b25e1a319fa5c7b701071c367d0772db7094
4
+ data.tar.gz: 80e0af200583ccd374813a8d8998cf751c3445d5f3dab58f27942bdd186b658f
5
5
  SHA512:
6
- metadata.gz: a21edafacd7f8878d97160965758eab907fb38d91e4ed4bb76b011cc846b9f81b2081208e16be80c4a03ca754caaa65b444866ac079fe940dfa8ae61bac3a0b2
7
- data.tar.gz: b23436b47922eb3cbd7f4fe772752c76a7e6fdd8e60f653fa8bdaabac7b320b9465552e205ca1671d08d133d9a53afdf0eabbb87dea81b8dc52b450ca0d60f52
6
+ metadata.gz: 66fd1b30d426356b447888a9a207239213c29bcd178126f6dc1751ed9a494cd304047cc4e42db2899e4784547732f8f2af85191d270691235a824b7c11b28e1e
7
+ data.tar.gz: 48d3094905367f87c57bace46c22b321c573658eb452d73ba6ca074fa5b47195e8113eab397c16d18bd04ad01856150e0dddb1f8856b2159139d696c26a0ad2b
@@ -6,6 +6,7 @@ module ItemModels
6
6
  class Error < StandardError; end
7
7
  # Your code goes here...
8
8
  def self.load
9
+ require directory + '/lib/models/item_application_record'
9
10
  files.each {|file| require file }
10
11
  end
11
12
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ItemModels
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.8'
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Activity < ApplicationRecord
3
+ class Activity < ItemApplicationRecord
4
4
  self.table_name = 'item_activities'
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class AvailabilityOption < ApplicationRecord
3
+ class AvailabilityOption < ItemApplicationRecord
4
4
  self.table_name = 'item_availability_options'
5
5
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Bundle < ApplicationRecord
3
+ class Bundle < ItemApplicationRecord
4
4
  self.table_name = 'item_bundles'
5
5
 
6
6
  belongs_to :variant
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class BundleVariant < ApplicationRecord
3
+ class BundleVariant < ItemApplicationRecord
4
4
  self.table_name = 'item_bundle_variants'
5
5
 
6
6
  belongs_to :bundle
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Image < ApplicationRecord
3
+ class Image < ItemApplicationRecord
4
4
  self.table_name = 'item_images'
5
5
 
6
6
  belongs_to :item
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Item < ApplicationRecord
3
+ class Item < ItemApplicationRecord
4
4
  has_many :variants
5
5
  has_many :item_listings
6
6
  has_many :bundles
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ItemApplicationRecord < ActiveRecord::Base
4
+ self.abstract_class = true
5
+ connects_to database: { writing: :item_model, reading: :item_model }
6
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class ItemListing < ApplicationRecord
3
+ class ItemListing < ItemApplicationRecord
4
4
  self.table_name = 'item_channel_associations'
5
5
  belongs_to :item
6
6
  has_many :variant_listings, foreign_key: :channel_association_id
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class ItemListingBrand < ApplicationRecord
3
+ class ItemListingBrand < ItemApplicationRecord
4
4
  self.table_name = 'item_channel_association_brands'
5
5
 
6
6
  belongs_to :item_listing, foreign_key: :channel_association_id
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class ItemListingCategory < ApplicationRecord
3
+ class ItemListingCategory < ItemApplicationRecord
4
4
  self.table_name = 'item_channel_association_categories'
5
5
 
6
6
  belongs_to :item_listing, foreign_key: :channel_association_id
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class ItemListingCustomField < ApplicationRecord
3
+ class ItemListingCustomField < ItemApplicationRecord
4
4
  self.table_name = 'item_channel_association_custom_fields'
5
5
 
6
6
  belongs_to :item_listing, foreign_key: :channel_association_id
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class ItemListingImage < ApplicationRecord
3
+ class ItemListingImage < ItemApplicationRecord
4
4
  self.table_name = 'item_channel_association_images'
5
5
  belongs_to :image
6
6
  belongs_to :item_listing, foreign_key: :channel_association_id
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class ItemListingVariantCustomField < ApplicationRecord
3
+ class ItemListingVariantCustomField < ItemApplicationRecord
4
4
  self.table_name = 'item_channel_association_variant_images'
5
5
 
6
6
  belongs_to :item_listing, foreign_key: :channel_association_id
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class ItemListingVariantImage < ApplicationRecord
3
+ class ItemListingVariantImage < ItemApplicationRecord
4
4
  self.table_name = 'item_channel_association_variant_images'
5
5
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class MasterCatalog < ApplicationRecord
3
+ class MasterCatalog < ItemApplicationRecord
4
4
  self.table_name = 'item_variant_master_assocs'
5
5
 
6
6
  belongs_to :variant
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class MasterCatalogImage < ApplicationRecord
3
+ class MasterCatalogImage < ItemApplicationRecord
4
4
  self.table_name = 'item_variant_master_image_assocs'
5
5
 
6
6
  belongs_to :master_catalog, foreign_key: :master_assoc_id
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Variant < ApplicationRecord
3
+ class Variant < ItemApplicationRecord
4
4
  self.table_name = 'item_variants'
5
5
  belongs_to :item
6
6
  has_many :variant_images, foreign_key: :item_variant_id
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class VariantImage < ApplicationRecord
3
+ class VariantImage < ItemApplicationRecord
4
4
  self.table_name = 'item_variant_images'
5
5
 
6
6
  belongs_to :image
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class VariantListing < ApplicationRecord
3
+ class VariantListing < ItemApplicationRecord
4
4
  self.table_name = 'item_channel_association_variant_associations'
5
5
 
6
6
  belongs_to :variant
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class VariantListingPriceHistory < ApplicationRecord
3
+ class VariantListingPriceHistory < ItemApplicationRecord
4
4
  self.table_name = 'item_channel_association_variant_association_stock_allocations'
5
5
 
6
6
  belongs_to :variant_listing, foreign_key: :variant_association_id
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class VariantListingStockAllocation < ApplicationRecord
3
+ class VariantListingStockAllocation < ItemApplicationRecord
4
4
  self.table_name = 'item_channel_association_variant_association_stock_allocations'
5
5
 
6
6
  belongs_to :variant_listing, foreign_key: :variant_association_id
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class VariantOption < ApplicationRecord
3
+ class VariantOption < ItemApplicationRecord
4
4
  self.table_name = 'item_variant_options'
5
5
 
6
6
  has_many :variant_option_associations, foreign_key: :option_id
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class VariantOptionAssociation < ApplicationRecord
3
+ class VariantOptionAssociation < ItemApplicationRecord
4
4
  self.table_name = 'item_variant_option_associations'
5
5
 
6
6
  belongs_to :variant_option, foreign_key: :option_id
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.3
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - alexander
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-06 00:00:00.000000000 Z
11
+ date: 2020-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -55,6 +55,7 @@ dependencies:
55
55
  description:
56
56
  email:
57
57
  - alxibra@gmail.com
58
+ - ivanderkevin@gmail.com
58
59
  executables: []
59
60
  extensions: []
60
61
  extra_rdoc_files: []
@@ -67,6 +68,7 @@ files:
67
68
  - lib/models/bundle_variant.rb
68
69
  - lib/models/image.rb
69
70
  - lib/models/item.rb
71
+ - lib/models/item_application_record.rb
70
72
  - lib/models/item_listing.rb
71
73
  - lib/models/item_listing_brand.rb
72
74
  - lib/models/item_listing_category.rb