item_models 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e3c71347c285a7703860f412a56533fd48f5bfee54937b3db065f8297debd054
4
+ data.tar.gz: 82a0f0634bc58f1cb4d0a5e7278fb10dd65d8c8c7876208b9854cc7c8d9082f7
5
+ SHA512:
6
+ metadata.gz: a21edafacd7f8878d97160965758eab907fb38d91e4ed4bb76b011cc846b9f81b2081208e16be80c4a03ca754caaa65b444866ac079fe940dfa8ae61bac3a0b2
7
+ data.tar.gz: b23436b47922eb3cbd7f4fe772752c76a7e6fdd8e60f653fa8bdaabac7b320b9465552e205ca1671d08d133d9a53afdf0eabbb87dea81b8dc52b450ca0d60f52
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'item_models/version'
4
+
5
+ module ItemModels
6
+ class Error < StandardError; end
7
+ # Your code goes here...
8
+ def self.load
9
+ files.each {|file| require file }
10
+ end
11
+
12
+ private
13
+
14
+ def self.files
15
+ Dir[ directory + '/lib/models/*.rb']
16
+ end
17
+
18
+ def self.directory
19
+ Gem::Specification.find_by_name("item_models").gem_dir
20
+ end
21
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ItemModels
4
+ VERSION = '0.0.3'
5
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Activity < ApplicationRecord
4
+ self.table_name = 'item_activities'
5
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AvailabilityOption < ApplicationRecord
4
+ self.table_name = 'item_availability_options'
5
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Bundle < ApplicationRecord
4
+ self.table_name = 'item_bundles'
5
+
6
+ belongs_to :variant
7
+ belongs_to :item
8
+ has_many :bundle_variants
9
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ class BundleVariant < ApplicationRecord
4
+ self.table_name = 'item_bundle_variants'
5
+
6
+ belongs_to :bundle
7
+ belongs_to :variant
8
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Image < ApplicationRecord
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
11
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Item < ApplicationRecord
4
+ has_many :variants
5
+ has_many :item_listings
6
+ has_many :bundles
7
+ has_many :images
8
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ItemListing < ApplicationRecord
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
13
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ItemListingBrand < ApplicationRecord
4
+ self.table_name = 'item_channel_association_brands'
5
+
6
+ belongs_to :item_listing, foreign_key: :channel_association_id
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ItemListingCategory < ApplicationRecord
4
+ self.table_name = 'item_channel_association_categories'
5
+
6
+ belongs_to :item_listing, foreign_key: :channel_association_id
7
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ItemListingCustomField < ApplicationRecord
4
+ self.table_name = 'item_channel_association_custom_fields'
5
+
6
+ belongs_to :item_listing, foreign_key: :channel_association_id
7
+ belongs_to :variant
8
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ItemListingImage < ApplicationRecord
4
+ self.table_name = 'item_channel_association_images'
5
+ belongs_to :image
6
+ belongs_to :item_listing, foreign_key: :channel_association_id
7
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ItemListingVariantCustomField < ApplicationRecord
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
9
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ItemListingVariantImage < ApplicationRecord
4
+ self.table_name = 'item_channel_association_variant_images'
5
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ class MasterCatalog < ApplicationRecord
4
+ self.table_name = 'item_variant_master_assocs'
5
+
6
+ belongs_to :variant
7
+ has_many :master_catalog_images, foreign_key: :master_assoc_id
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ class MasterCatalogImage < ApplicationRecord
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
8
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Variant < ApplicationRecord
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
13
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ class VariantImage < ApplicationRecord
4
+ self.table_name = 'item_variant_images'
5
+
6
+ belongs_to :image
7
+ belongs_to :variant
8
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ class VariantListing < ApplicationRecord
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
10
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class VariantListingPriceHistory < ApplicationRecord
4
+ self.table_name = 'item_channel_association_variant_association_stock_allocations'
5
+
6
+ belongs_to :variant_listing, foreign_key: :variant_association_id
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class VariantListingStockAllocation < ApplicationRecord
4
+ self.table_name = 'item_channel_association_variant_association_stock_allocations'
5
+
6
+ belongs_to :variant_listing, foreign_key: :variant_association_id
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class VariantOption < ApplicationRecord
4
+ self.table_name = 'item_variant_options'
5
+
6
+ has_many :variant_option_associations, foreign_key: :option_id
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class VariantOptionAssociation < ApplicationRecord
4
+ self.table_name = 'item_variant_option_associations'
5
+
6
+ belongs_to :variant_option, foreign_key: :option_id
7
+ end
metadata ADDED
@@ -0,0 +1,110 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: item_models
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - alexander
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-02-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.17'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.17'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ description:
56
+ email:
57
+ - alxibra@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - lib/item_models.rb
63
+ - lib/item_models/version.rb
64
+ - lib/models/activity.rb
65
+ - lib/models/availability_option.rb
66
+ - lib/models/bundle.rb
67
+ - lib/models/bundle_variant.rb
68
+ - lib/models/image.rb
69
+ - lib/models/item.rb
70
+ - lib/models/item_listing.rb
71
+ - lib/models/item_listing_brand.rb
72
+ - lib/models/item_listing_category.rb
73
+ - lib/models/item_listing_custom_field.rb
74
+ - lib/models/item_listing_image.rb
75
+ - lib/models/item_listing_variant_custom_field.rb
76
+ - lib/models/item_listing_variant_image.rb
77
+ - lib/models/master_catalog.rb
78
+ - lib/models/master_catalog_image.rb
79
+ - lib/models/variant.rb
80
+ - lib/models/variant_image.rb
81
+ - lib/models/variant_listing.rb
82
+ - lib/models/variant_listing_price_history.rb
83
+ - lib/models/variant_listing_stock_allocation.rb
84
+ - lib/models/variant_option.rb
85
+ - lib/models/variant_option_association.rb
86
+ homepage:
87
+ licenses:
88
+ - MIT
89
+ metadata: {}
90
+ post_install_message:
91
+ rdoc_options: []
92
+ require_paths:
93
+ - lib
94
+ - lib/models
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubygems_version: 3.0.3
107
+ signing_key:
108
+ specification_version: 4
109
+ summary: gem for active record item models
110
+ test_files: []