subj_models 0.5.6 → 0.5.7
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 +4 -4
- data/lib/subj_models/{action.rb → action_banner.rb} +4 -4
- data/lib/subj_models/brand.rb +1 -1
- data/lib/subj_models/city.rb +1 -1
- data/lib/subj_models/nomenclature.rb +3 -3
- data/lib/subj_models/user.rb +1 -1
- data/lib/subj_models/user_card_delivery.rb +3 -3
- data/lib/subj_models/version.rb +1 -1
- data/lib/subj_models.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13e68be2013b8160600f9f167582d78f66f6d180
|
4
|
+
data.tar.gz: a7aaa81aadc429f92e74d573e2c9a2168c2c6fce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 222f53d56544d09ed813bb83dca645f62371d9f58de4461a05712c2ba0a2aeaf702cd7229ee83b4ef057328fc3d2ec7b2c0c386fed37a7705e11a0d0b0dd793e
|
7
|
+
data.tar.gz: cfe5aad30c72c587ffe116ad987cae2c49226c862e3f481d9c35f6340e6245d9c819731630957117d6e5d1685c86eb299ee874c196266c3ea4e501df6e4e277d
|
@@ -2,7 +2,7 @@ require 'subj_models/concerns/comprising_external_id'
|
|
2
2
|
|
3
3
|
module SubjModels
|
4
4
|
|
5
|
-
module
|
5
|
+
module ActionBannerModule
|
6
6
|
|
7
7
|
def self.included(including_class)
|
8
8
|
|
@@ -18,9 +18,9 @@ module SubjModels
|
|
18
18
|
|
19
19
|
validates :nomenclatures, presence: true
|
20
20
|
validates :name, presence: true
|
21
|
-
validates :discount_percent,
|
22
|
-
|
23
|
-
|
21
|
+
# validates :discount_percent,
|
22
|
+
# presence: true,
|
23
|
+
# numericality: {only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: 100}
|
24
24
|
|
25
25
|
scope :to_show, -> condition { where(to_show: condition) }
|
26
26
|
|
data/lib/subj_models/brand.rb
CHANGED
@@ -18,7 +18,7 @@ module SubjModels
|
|
18
18
|
has_many :events
|
19
19
|
|
20
20
|
has_and_belongs_to_many :users
|
21
|
-
has_and_belongs_to_many :
|
21
|
+
has_and_belongs_to_many :action_banners
|
22
22
|
|
23
23
|
belongs_to :content_block1, class_name: "ContentBlock"
|
24
24
|
belongs_to :content_block2, class_name: "ContentBlock"
|
data/lib/subj_models/city.rb
CHANGED
@@ -28,7 +28,7 @@ module SubjModels
|
|
28
28
|
belongs_to :bought_together_related_nomenclature, class_name: "Nomenclature"
|
29
29
|
has_many :bought_together, foreign_key: "bought_together_related_nomenclature_id", class_name: "Nomenclature"
|
30
30
|
|
31
|
-
has_and_belongs_to_many :
|
31
|
+
has_and_belongs_to_many :action_banners
|
32
32
|
has_and_belongs_to_many :access_groups, through: :nomenclature_access_groups
|
33
33
|
has_and_belongs_to_many :events
|
34
34
|
|
@@ -36,7 +36,7 @@ module SubjModels
|
|
36
36
|
|
37
37
|
scope :with_category, -> { where.not(category_id: nil) }
|
38
38
|
scope :brand_line_ids, -> (brand_line_id) { where(brand_line_id: brand_line_id) }
|
39
|
-
scope :with_action, -> { joins(:
|
39
|
+
scope :with_action, -> { joins(:action_banners).distinct }
|
40
40
|
scope :is_recommended, -> condition { where(is_recommended: condition) }
|
41
41
|
scope :in_index_list, -> condition { where(show_on_index: condition) }
|
42
42
|
scope :is_stock, -> (condition) do
|
@@ -58,7 +58,7 @@ module SubjModels
|
|
58
58
|
end
|
59
59
|
|
60
60
|
scope :only_promotional, -> do
|
61
|
-
joins(:
|
61
|
+
joins(:action_banners).uniq
|
62
62
|
end
|
63
63
|
|
64
64
|
scope :is_professional, -> (condition) {where(is_professional: condition) }
|
data/lib/subj_models/user.rb
CHANGED
@@ -63,7 +63,7 @@ module SubjModels
|
|
63
63
|
|
64
64
|
scope :external_id, -> external_id do
|
65
65
|
external_id ? where(external_id: external_id) : User.none
|
66
|
-
end
|
66
|
+
end
|
67
67
|
|
68
68
|
scope :internal_users, -> (condition) do
|
69
69
|
joins(:user_card_delivery).where.not(user_card_deliveries: {id: nil} ).where(external_id: nil)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'subj_models/
|
1
|
+
require 'subj_models/concerns/comprising_external_id'
|
2
2
|
module SubjModels
|
3
3
|
|
4
4
|
module UserCardDeliveryModule
|
@@ -7,10 +7,10 @@ module SubjModels
|
|
7
7
|
|
8
8
|
def self.included(including_class)
|
9
9
|
|
10
|
-
including_class.class_eval do
|
11
10
|
|
11
|
+
including_class.class_eval do
|
12
12
|
|
13
|
-
|
13
|
+
include SubjModels::ComprisingExternalId
|
14
14
|
|
15
15
|
belongs_to :user
|
16
16
|
|
data/lib/subj_models/version.rb
CHANGED
data/lib/subj_models.rb
CHANGED
@@ -32,7 +32,7 @@ require 'subj_models/specialist_activity_document_type'
|
|
32
32
|
require 'subj_models/nomenclature_attribute'
|
33
33
|
require 'subj_models/category'
|
34
34
|
require 'subj_models/nomenclature_review'
|
35
|
-
require 'subj_models/
|
35
|
+
require 'subj_models/action_banner'
|
36
36
|
require 'subj_models/event_type'
|
37
37
|
require 'subj_models/office_contact'
|
38
38
|
require 'subj_models/order_delivery_courier'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: subj_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denys Dvoriashyn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -58,7 +58,7 @@ files:
|
|
58
58
|
- bin/setup
|
59
59
|
- lib/subj_models.rb
|
60
60
|
- lib/subj_models/access_group.rb
|
61
|
-
- lib/subj_models/
|
61
|
+
- lib/subj_models/action_banner.rb
|
62
62
|
- lib/subj_models/attribute_value.rb
|
63
63
|
- lib/subj_models/brand.rb
|
64
64
|
- lib/subj_models/brand_line.rb
|