metka 2.2.1 → 2.3.0

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
  SHA256:
3
- metadata.gz: 70ed1a14d6c370fa9c6ab618ba8224051e48ba3e856f183ce2caeb3454ab99c1
4
- data.tar.gz: 5f536ff19a834c1215b775550703b531c841197b30ba4e03a205110d19226d83
3
+ metadata.gz: 63abcec9261f272c219d1a6cfcad32dd7d0c7898191d7914c74c3f0a892015c6
4
+ data.tar.gz: fcf4bfed70ff8f3933543ace8902125dd3b2a34e0bcde143f15e829a83eccd60
5
5
  SHA512:
6
- metadata.gz: 7b8da3e7b194074d8c1c44a37bc7f1da79715b50a1ac6b07c723c15bf9843fda3f1e533bc21fe4af33c7fbaf1f87749033120fbbc642256a5d0186cddaac02f1
7
- data.tar.gz: 2473535185adc7dfdc4b8454dc06ffef885a5e6d867e9748b55b6e5415df621dc5af31e6b595815e79c6990cfa08e958ceec6285190c30886846cb90c6a33596
6
+ metadata.gz: 4b6571d0d1efae326e4aef32c0184ba71323deb737358c1271889b2ef88d05addd5b109c4d82aac22111e22231ab75172b56addf39d9c93a395cecffaf542b3d
7
+ data.tar.gz: 9c711b3639ce53cc8d953bbd8cf5634ee184d821734ff19162c50f24a07d8825506f4223c0b2c1397f5142e7578e0eea55d50b88c0eb4d55e6d8a8aa2c001bea
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- metka (2.1.0)
4
+ metka (2.2.1)
5
5
  dry-configurable (>= 0.8)
6
6
  rails (>= 5.2)
7
7
 
data/README.md CHANGED
@@ -73,7 +73,10 @@ Song.with_all_tags('top, 1990')
73
73
  #=> []
74
74
 
75
75
  Song.with_all_tags('')
76
- #=> []
76
+ #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
77
+
78
+ Song.with_all_tags(nil)
79
+ #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
77
80
 
78
81
  Song.with_all_genres('rock')
79
82
  #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
@@ -89,7 +92,10 @@ Song.with_any_tags('chill, 1980')
89
92
  #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
90
93
 
91
94
  Song.with_any_tags('')
92
- #=> []
95
+ #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
96
+
97
+ Song.with_any_tags(nil)
98
+ #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
93
99
 
94
100
  Song.with_any_genres('rock, rap')
95
101
  #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
@@ -105,7 +111,10 @@ Song.without_all_tags('top, 1990')
105
111
  #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
106
112
 
107
113
  Song.without_all_tags('')
108
- #=> []
114
+ #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
115
+
116
+ Song.without_all_tags(nil)
117
+ #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
109
118
 
110
119
  Song.without_all_genres('rock, pop')
111
120
  #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
@@ -127,7 +136,10 @@ Song.without_any_genres('rock, pop')
127
136
  #=> []
128
137
 
129
138
  Song.without_any_genres('')
130
- #=> []
139
+ #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
140
+
141
+ Song.without_any_genres(nil)
142
+ #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
131
143
  ```
132
144
 
133
145
  ### .tagged_with
@@ -140,7 +152,10 @@ Song.tagged_with('top, 1990')
140
152
  #=> []
141
153
 
142
154
  Song.tagged_with('')
143
- #=> []
155
+ #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
156
+
157
+ Song.tagged_with(nil)
158
+ #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
144
159
 
145
160
  Song.tagged_with('rock')
146
161
  #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
@@ -155,7 +170,7 @@ Song.tagged_with('chill, 1980', any: true)
155
170
  #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
156
171
 
157
172
  Song.tagged_with('', any: true)
158
- #=> []
173
+ #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
159
174
 
160
175
  Song.tagged_with('rock, rap', any: true, on: ['genres'])
161
176
  #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
@@ -167,7 +182,7 @@ Song.tagged_with('top, 1990', exclude: true)
167
182
  #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
168
183
 
169
184
  Song.tagged_with('', exclude: true)
170
- #=> []
185
+ #=> [#<Song id: 1, title: 'Migrate tags in Rails to PostgreSQL', tags: ['top', 'chill'], genres: ['rock', 'jazz', 'pop']]
171
186
 
172
187
  Song.tagged_with('top, 1990', any: true, exclude: true)
173
188
  #=> []
data/lib/metka/model.rb CHANGED
@@ -35,7 +35,7 @@ module Metka
35
35
  cols = options.delete(:on)
36
36
  parsed_tag_list = parser.call(tags)
37
37
 
38
- return model.none if parsed_tag_list.empty?
38
+ return model if parsed_tag_list.empty?
39
39
 
40
40
  request = ::Metka::QueryBuilder.new.call(model, cols, parsed_tag_list, options)
41
41
  model.where(request)
data/lib/metka/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Metka
4
- VERSION = '2.2.1'
4
+ VERSION = '2.3.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metka
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Alexandrov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-01-11 00:00:00.000000000 Z
12
+ date: 2021-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dry-configurable