metka 2.2.1 → 2.3.0
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/Gemfile.lock +1 -1
- data/README.md +22 -7
- data/lib/metka/model.rb +1 -1
- data/lib/metka/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 63abcec9261f272c219d1a6cfcad32dd7d0c7898191d7914c74c3f0a892015c6
|
|
4
|
+
data.tar.gz: fcf4bfed70ff8f3933543ace8902125dd3b2a34e0bcde143f15e829a83eccd60
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4b6571d0d1efae326e4aef32c0184ba71323deb737358c1271889b2ef88d05addd5b109c4d82aac22111e22231ab75172b56addf39d9c93a395cecffaf542b3d
|
|
7
|
+
data.tar.gz: 9c711b3639ce53cc8d953bbd8cf5634ee184d821734ff19162c50f24a07d8825506f4223c0b2c1397f5142e7578e0eea55d50b88c0eb4d55e6d8a8aa2c001bea
|
data/Gemfile.lock
CHANGED
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
|
|
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
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.
|
|
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-
|
|
12
|
+
date: 2021-02-05 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: dry-configurable
|