subj_models 0.5.6 → 0.5.7

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
  SHA1:
3
- metadata.gz: 9612e3ebe8ad3f2f446ad3030bc0642a464e423c
4
- data.tar.gz: 8b21fb022080a9ababfce82979f5da4290b710cf
3
+ metadata.gz: 13e68be2013b8160600f9f167582d78f66f6d180
4
+ data.tar.gz: a7aaa81aadc429f92e74d573e2c9a2168c2c6fce
5
5
  SHA512:
6
- metadata.gz: b6374858290649e3eedb02500079768d1ecfe4967138f3c666ac054eb6642202b9ff16593a7ffc0a63be8b202549a80d45c45c48ed2453cea81060e42014b023
7
- data.tar.gz: e4c0d9b9437c59364f084277c7679b5bb41e60e90f2674c0e8f3f5972dd201a27d8bfb3c90033ae7e9563dd6376a125bce260ada800e489d1a2c50db110a6001
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 ActionModule
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
- presence: true,
23
- numericality: {only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: 100}
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
 
@@ -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 :actions
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"
@@ -10,7 +10,7 @@ module SubjModels
10
10
 
11
11
  include SubjModels::ComprisingExternalId
12
12
 
13
- has_and_belongs_to_many :actions
13
+ has_and_belongs_to_many :action_banners
14
14
  has_many :offices
15
15
  has_many :users
16
16
 
@@ -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 :actions
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(:actions).distinct }
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(:actions).uniq
61
+ joins(:action_banners).uniq
62
62
  end
63
63
 
64
64
  scope :is_professional, -> (condition) {where(is_professional: condition) }
@@ -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/services/types_support'
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
- # enum delivery_type: CARD_RECEIVE_TYPES
13
+ include SubjModels::ComprisingExternalId
14
14
 
15
15
  belongs_to :user
16
16
 
@@ -1,3 +1,3 @@
1
1
  module SubjModels
2
- VERSION = "0.5.6"
2
+ VERSION = "0.5.7"
3
3
  end
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/action'
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.6
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-06 00:00:00.000000000 Z
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/action.rb
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