subj_models 0.6.1 → 0.6.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c6d36035574e76fbcc49624856b8d77a9965e91
4
- data.tar.gz: 481a7a03a4a3cf347fb44bfea0d330da34c6161d
3
+ metadata.gz: 6be86b8073df7d9487f0477643a54708def640ba
4
+ data.tar.gz: 00872dd31df04e47fe7d84de05ed4fc83525b851
5
5
  SHA512:
6
- metadata.gz: 68d14e831b4e3d76bd5d8e4245de9b25a6e8cb3fc5510ac3f1b37edf243d41f92b88b7d5432a24c44cbfc2d6ba617de53f6099a910b2653a6b6b706a637f8edb
7
- data.tar.gz: 4bcb9a9c3cc8e3ab1c86a024d50a04cbf244842eeff0c32d0ad73f3dcd4d800ad644b11018070949dc4af74dd6533ca428c0ae2f2ae88ec70a97d580e491f711
6
+ metadata.gz: 58c7a3f683cdda033b0fa901d19b7d1575d585a02b6aff2b0454e8347b1fcbe904f1cff6465c65c88847ce9e7a31787cadf2f12bb3c7f2a2342258e15382c02a
7
+ data.tar.gz: 9506865fd2526a71e9b56248d4aa9e6303edcf713735f867de0246ec8c38b847ade587e12d4cad7a8929de4d735958ed1265bdea1c1dbf4140f7bde95b179d33
@@ -81,12 +81,16 @@ module SubjModels
81
81
 
82
82
  scope :order_by_name, -> (ordering) do
83
83
  ordering = ordering.second.try(:to_sym)
84
- order(name: ordering)
84
+ if [:asc, :desc].include? ordering
85
+ order(name: ordering)
86
+ end
85
87
  end
86
88
 
87
89
  scope :order_by_popularity, -> (ordering) do
88
90
  ordering = ordering.second.try(:to_sym)
89
- order(popularity: ordering)
91
+ if [:asc, :desc].include? ordering
92
+ order(popularity: ordering)
93
+ end
90
94
  end
91
95
 
92
96
  scope :attribute_value_ids, -> (attribute_value_name_strings) do
@@ -1,3 +1,3 @@
1
1
  module SubjModels
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
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.6.1
4
+ version: 0.6.2
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-16 00:00:00.000000000 Z
11
+ date: 2016-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler