subj_sub_models 0.0.3.20 → 0.0.3.21

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: 4a39dd55189d841a115d88e0e5d87e7e5210c845
4
- data.tar.gz: 6eb4f40d8118a559dc97d2bf9c532995f7752d0d
3
+ metadata.gz: 41740d28007d00615a15a3cd8bfbcb968edbea07
4
+ data.tar.gz: b557a08e432d992068565ad0beea547a0566a88a
5
5
  SHA512:
6
- metadata.gz: a043816bc16a580268de8d5e00bc83d3ca125775ffa330fb0dd6c567a17d452b822411ae5b1253003169cad545d9e9954cac3f324c4d1b4287c8bab354e0553c
7
- data.tar.gz: 7406902f0cf3805c619e05dea2e1a477387714002691ceae620f8e6606ba065e3a50f53de30c3d6ccff511a62df236a4732b54b03d289141ae61afacd44f9f3c
6
+ metadata.gz: ce5d7e8c6c5559ba39267a0f2ab27ed1d9a924c8fb0fd5813b070ffed13d2fee760c84881aef5613dff1b409bedff3e3e4a7c9a75eadfcb4e42cc09f3fb2d47f
7
+ data.tar.gz: 9d833493905a4bde600c1b78eb1725d72f470651b2532b3e72e272da751aacffe47454d78097fee11329ec395c1a9c1f89ea46cc295ae8bade824a3c0546bd5d
@@ -15,6 +15,7 @@ module SubjModels
15
15
  has_many :user_videos, dependent: :destroy
16
16
  has_many :brand_lines, dependent: :destroy
17
17
  has_many :nomenclatures
18
+ has_many :categories, through: :nomenclatures
18
19
  has_many :videos
19
20
  has_many :events
20
21
 
@@ -38,6 +39,8 @@ module SubjModels
38
39
  joins(brand_lines: [{ nomenclatures: :category}]).where('categories.id' => category_id)
39
40
  end
40
41
 
42
+ scope :with_categories, -> condition { includes(categories: [:image, :image_big, :nomenclatures]) }
43
+
41
44
  scope :by_first_letters, -> (by_first_letters) do
42
45
  unless by_first_letters.blank?
43
46
  where(first_letter: by_first_letters)
@@ -72,4 +75,4 @@ module SubjModels
72
75
 
73
76
  end
74
77
 
75
- end
78
+ end
@@ -11,6 +11,7 @@ module SubjModels
11
11
  include SubjModels::ComprisingExternalId
12
12
 
13
13
  has_many :nomenclatures
14
+ has_many :brands, through: :nomenclatures
14
15
 
15
16
  belongs_to :image, class_name: "DocumentFile"
16
17
  belongs_to :image_big, class_name: "DocumentFile"
@@ -33,4 +34,4 @@ module SubjModels
33
34
 
34
35
  end
35
36
 
36
- end
37
+ end
@@ -1,3 +1,3 @@
1
1
  module SubjModels
2
- VERSION = '0.0.3.20'
2
+ VERSION = '0.0.3.21'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subj_sub_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3.20
4
+ version: 0.0.3.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - A.Nasa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-04 00:00:00.000000000 Z
11
+ date: 2017-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler