metka 2.2.1 → 2.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/{rubocop.yml → lint_code.yml} +1 -1
- data/.github/workflows/{docs.yml → lint_docs.yml} +0 -0
- data/.github/workflows/{rspec.yml → specs.yml} +4 -2
- data/Gemfile.lock +92 -89
- data/README.md +52 -8
- data/gemfiles/{railsmaster.gemfile → railsmain.gemfile} +1 -1
- data/lib/metka/model.rb +1 -1
- data/lib/metka/version.rb +1 -1
- data/lib/metka.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfd8b3b69ee013c8f4eb1ec5566e3bc71153f7d6f38f01e5d17e27bd8e3655de
|
4
|
+
data.tar.gz: 030f39ea5a83822005c3dffb6b31d9ba534e84da4fe03c2ef3bd7a369d9db7a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e9f39536bf9162217c1460045df8374de00348be8a318a30bf6d06e1dd5cfd1e417caf989d2f3392a2f70195401ba7ffb40551fdfdc1c21b6bbf4c1973d7ae0
|
7
|
+
data.tar.gz: f905210fcd3ff94f853e900570a19882b4eb19e7f699947eb8ffce1930a381dde0de37e2065b13ea8f40efe64af537bd28d7b6485feb943c5778b2f6bb592c0e
|
File without changes
|
@@ -1,10 +1,12 @@
|
|
1
|
-
name:
|
1
|
+
name: Specs
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
5
|
branches:
|
6
6
|
- master
|
7
7
|
pull_request:
|
8
|
+
schedule:
|
9
|
+
- cron: "0 3 * * 1" # Every monday at 3 AM
|
8
10
|
|
9
11
|
jobs:
|
10
12
|
rspec:
|
@@ -27,7 +29,7 @@ jobs:
|
|
27
29
|
include:
|
28
30
|
- ruby: "3.0"
|
29
31
|
postgres: "13"
|
30
|
-
gemfile: "gemfiles/
|
32
|
+
gemfile: "gemfiles/railsmain.gemfile"
|
31
33
|
fx: "false"
|
32
34
|
- ruby: "2.6"
|
33
35
|
postgres: "12"
|
data/Gemfile.lock
CHANGED
@@ -1,145 +1,148 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
metka (2.
|
4
|
+
metka (2.3.2)
|
5
5
|
dry-configurable (>= 0.8)
|
6
6
|
rails (>= 5.2)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actioncable (6.1.
|
12
|
-
actionpack (= 6.1.
|
13
|
-
activesupport (= 6.1.
|
11
|
+
actioncable (6.1.4.1)
|
12
|
+
actionpack (= 6.1.4.1)
|
13
|
+
activesupport (= 6.1.4.1)
|
14
14
|
nio4r (~> 2.0)
|
15
15
|
websocket-driver (>= 0.6.1)
|
16
|
-
actionmailbox (6.1.
|
17
|
-
actionpack (= 6.1.
|
18
|
-
activejob (= 6.1.
|
19
|
-
activerecord (= 6.1.
|
20
|
-
activestorage (= 6.1.
|
21
|
-
activesupport (= 6.1.
|
16
|
+
actionmailbox (6.1.4.1)
|
17
|
+
actionpack (= 6.1.4.1)
|
18
|
+
activejob (= 6.1.4.1)
|
19
|
+
activerecord (= 6.1.4.1)
|
20
|
+
activestorage (= 6.1.4.1)
|
21
|
+
activesupport (= 6.1.4.1)
|
22
22
|
mail (>= 2.7.1)
|
23
|
-
actionmailer (6.1.
|
24
|
-
actionpack (= 6.1.
|
25
|
-
actionview (= 6.1.
|
26
|
-
activejob (= 6.1.
|
27
|
-
activesupport (= 6.1.
|
23
|
+
actionmailer (6.1.4.1)
|
24
|
+
actionpack (= 6.1.4.1)
|
25
|
+
actionview (= 6.1.4.1)
|
26
|
+
activejob (= 6.1.4.1)
|
27
|
+
activesupport (= 6.1.4.1)
|
28
28
|
mail (~> 2.5, >= 2.5.4)
|
29
29
|
rails-dom-testing (~> 2.0)
|
30
|
-
actionpack (6.1.
|
31
|
-
actionview (= 6.1.
|
32
|
-
activesupport (= 6.1.
|
30
|
+
actionpack (6.1.4.1)
|
31
|
+
actionview (= 6.1.4.1)
|
32
|
+
activesupport (= 6.1.4.1)
|
33
33
|
rack (~> 2.0, >= 2.0.9)
|
34
34
|
rack-test (>= 0.6.3)
|
35
35
|
rails-dom-testing (~> 2.0)
|
36
36
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
37
|
-
actiontext (6.1.
|
38
|
-
actionpack (= 6.1.
|
39
|
-
activerecord (= 6.1.
|
40
|
-
activestorage (= 6.1.
|
41
|
-
activesupport (= 6.1.
|
37
|
+
actiontext (6.1.4.1)
|
38
|
+
actionpack (= 6.1.4.1)
|
39
|
+
activerecord (= 6.1.4.1)
|
40
|
+
activestorage (= 6.1.4.1)
|
41
|
+
activesupport (= 6.1.4.1)
|
42
42
|
nokogiri (>= 1.8.5)
|
43
|
-
actionview (6.1.
|
44
|
-
activesupport (= 6.1.
|
43
|
+
actionview (6.1.4.1)
|
44
|
+
activesupport (= 6.1.4.1)
|
45
45
|
builder (~> 3.1)
|
46
46
|
erubi (~> 1.4)
|
47
47
|
rails-dom-testing (~> 2.0)
|
48
48
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
49
|
-
activejob (6.1.
|
50
|
-
activesupport (= 6.1.
|
49
|
+
activejob (6.1.4.1)
|
50
|
+
activesupport (= 6.1.4.1)
|
51
51
|
globalid (>= 0.3.6)
|
52
|
-
activemodel (6.1.
|
53
|
-
activesupport (= 6.1.
|
54
|
-
activerecord (6.1.
|
55
|
-
activemodel (= 6.1.
|
56
|
-
activesupport (= 6.1.
|
57
|
-
activestorage (6.1.
|
58
|
-
actionpack (= 6.1.
|
59
|
-
activejob (= 6.1.
|
60
|
-
activerecord (= 6.1.
|
61
|
-
activesupport (= 6.1.
|
62
|
-
marcel (~> 0.
|
63
|
-
|
64
|
-
activesupport (6.1.
|
52
|
+
activemodel (6.1.4.1)
|
53
|
+
activesupport (= 6.1.4.1)
|
54
|
+
activerecord (6.1.4.1)
|
55
|
+
activemodel (= 6.1.4.1)
|
56
|
+
activesupport (= 6.1.4.1)
|
57
|
+
activestorage (6.1.4.1)
|
58
|
+
actionpack (= 6.1.4.1)
|
59
|
+
activejob (= 6.1.4.1)
|
60
|
+
activerecord (= 6.1.4.1)
|
61
|
+
activesupport (= 6.1.4.1)
|
62
|
+
marcel (~> 1.0.0)
|
63
|
+
mini_mime (>= 1.1.0)
|
64
|
+
activesupport (6.1.4.1)
|
65
65
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
66
66
|
i18n (>= 1.6, < 2)
|
67
67
|
minitest (>= 5.1)
|
68
68
|
tzinfo (~> 2.0)
|
69
69
|
zeitwerk (~> 2.3)
|
70
|
-
ammeter (1.1.
|
70
|
+
ammeter (1.1.5)
|
71
71
|
activesupport (>= 3.0)
|
72
72
|
railties (>= 3.0)
|
73
73
|
rspec-rails (>= 2.2)
|
74
74
|
builder (3.2.4)
|
75
75
|
coderay (1.1.3)
|
76
|
-
concurrent-ruby (1.1.
|
76
|
+
concurrent-ruby (1.1.9)
|
77
77
|
crass (1.0.6)
|
78
|
-
database_cleaner (
|
78
|
+
database_cleaner (2.0.1)
|
79
|
+
database_cleaner-active_record (~> 2.0.0)
|
80
|
+
database_cleaner-active_record (2.0.0)
|
81
|
+
activerecord (>= 5.a)
|
82
|
+
database_cleaner-core (~> 2.0.0)
|
83
|
+
database_cleaner-core (2.0.1)
|
79
84
|
diff-lcs (1.4.4)
|
80
|
-
dry-configurable (0.
|
85
|
+
dry-configurable (0.13.0)
|
81
86
|
concurrent-ruby (~> 1.0)
|
82
|
-
dry-core (~> 0.
|
83
|
-
dry-core (0.
|
87
|
+
dry-core (~> 0.6)
|
88
|
+
dry-core (0.7.1)
|
84
89
|
concurrent-ruby (~> 1.0)
|
85
90
|
erubi (1.10.0)
|
86
|
-
faker (2.
|
91
|
+
faker (2.17.0)
|
87
92
|
i18n (>= 1.6, < 2)
|
88
|
-
globalid (0.
|
89
|
-
activesupport (>=
|
90
|
-
i18n (1.8.
|
93
|
+
globalid (0.5.2)
|
94
|
+
activesupport (>= 5.0)
|
95
|
+
i18n (1.8.10)
|
91
96
|
concurrent-ruby (~> 1.0)
|
92
|
-
loofah (2.
|
97
|
+
loofah (2.12.0)
|
93
98
|
crass (~> 1.0.2)
|
94
99
|
nokogiri (>= 1.5.9)
|
95
100
|
mail (2.7.1)
|
96
101
|
mini_mime (>= 0.1.1)
|
97
|
-
marcel (0.
|
98
|
-
mimemagic (~> 0.3.2)
|
102
|
+
marcel (1.0.2)
|
99
103
|
method_source (1.0.0)
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
mini_portile2 (~> 2.5.0)
|
104
|
+
mini_mime (1.1.1)
|
105
|
+
mini_portile2 (2.6.1)
|
106
|
+
minitest (5.14.4)
|
107
|
+
nio4r (2.5.8)
|
108
|
+
nokogiri (1.12.5)
|
109
|
+
mini_portile2 (~> 2.6.1)
|
107
110
|
racc (~> 1.4)
|
108
111
|
pg (1.2.3)
|
109
|
-
pry (0.
|
112
|
+
pry (0.14.0)
|
110
113
|
coderay (~> 1.1)
|
111
114
|
method_source (~> 1.0)
|
112
115
|
racc (1.5.2)
|
113
116
|
rack (2.2.3)
|
114
117
|
rack-test (1.1.0)
|
115
118
|
rack (>= 1.0, < 3)
|
116
|
-
rails (6.1.
|
117
|
-
actioncable (= 6.1.
|
118
|
-
actionmailbox (= 6.1.
|
119
|
-
actionmailer (= 6.1.
|
120
|
-
actionpack (= 6.1.
|
121
|
-
actiontext (= 6.1.
|
122
|
-
actionview (= 6.1.
|
123
|
-
activejob (= 6.1.
|
124
|
-
activemodel (= 6.1.
|
125
|
-
activerecord (= 6.1.
|
126
|
-
activestorage (= 6.1.
|
127
|
-
activesupport (= 6.1.
|
119
|
+
rails (6.1.4.1)
|
120
|
+
actioncable (= 6.1.4.1)
|
121
|
+
actionmailbox (= 6.1.4.1)
|
122
|
+
actionmailer (= 6.1.4.1)
|
123
|
+
actionpack (= 6.1.4.1)
|
124
|
+
actiontext (= 6.1.4.1)
|
125
|
+
actionview (= 6.1.4.1)
|
126
|
+
activejob (= 6.1.4.1)
|
127
|
+
activemodel (= 6.1.4.1)
|
128
|
+
activerecord (= 6.1.4.1)
|
129
|
+
activestorage (= 6.1.4.1)
|
130
|
+
activesupport (= 6.1.4.1)
|
128
131
|
bundler (>= 1.15.0)
|
129
|
-
railties (= 6.1.
|
132
|
+
railties (= 6.1.4.1)
|
130
133
|
sprockets-rails (>= 2.0.0)
|
131
134
|
rails-dom-testing (2.0.3)
|
132
135
|
activesupport (>= 4.2.0)
|
133
136
|
nokogiri (>= 1.6)
|
134
|
-
rails-html-sanitizer (1.
|
137
|
+
rails-html-sanitizer (1.4.2)
|
135
138
|
loofah (~> 2.3)
|
136
|
-
railties (6.1.
|
137
|
-
actionpack (= 6.1.
|
138
|
-
activesupport (= 6.1.
|
139
|
+
railties (6.1.4.1)
|
140
|
+
actionpack (= 6.1.4.1)
|
141
|
+
activesupport (= 6.1.4.1)
|
139
142
|
method_source
|
140
|
-
rake (>= 0.
|
143
|
+
rake (>= 0.13)
|
141
144
|
thor (~> 1.0)
|
142
|
-
rake (13.0.
|
145
|
+
rake (13.0.6)
|
143
146
|
rspec (3.10.0)
|
144
147
|
rspec-core (~> 3.10.0)
|
145
148
|
rspec-expectations (~> 3.10.0)
|
@@ -149,18 +152,18 @@ GEM
|
|
149
152
|
rspec-expectations (3.10.1)
|
150
153
|
diff-lcs (>= 1.2.0, < 2.0)
|
151
154
|
rspec-support (~> 3.10.0)
|
152
|
-
rspec-mocks (3.10.
|
155
|
+
rspec-mocks (3.10.2)
|
153
156
|
diff-lcs (>= 1.2.0, < 2.0)
|
154
157
|
rspec-support (~> 3.10.0)
|
155
|
-
rspec-rails (
|
156
|
-
actionpack (>=
|
157
|
-
activesupport (>=
|
158
|
-
railties (>=
|
158
|
+
rspec-rails (5.0.1)
|
159
|
+
actionpack (>= 5.2)
|
160
|
+
activesupport (>= 5.2)
|
161
|
+
railties (>= 5.2)
|
159
162
|
rspec-core (~> 3.10)
|
160
163
|
rspec-expectations (~> 3.10)
|
161
164
|
rspec-mocks (~> 3.10)
|
162
165
|
rspec-support (~> 3.10)
|
163
|
-
rspec-support (3.10.
|
166
|
+
rspec-support (3.10.2)
|
164
167
|
sprockets (4.0.2)
|
165
168
|
concurrent-ruby (~> 1.0)
|
166
169
|
rack (> 1, < 3)
|
@@ -168,11 +171,11 @@ GEM
|
|
168
171
|
actionpack (>= 4.0)
|
169
172
|
activesupport (>= 4.0)
|
170
173
|
sprockets (>= 3.0.0)
|
171
|
-
thor (1.0
|
172
|
-
timecop (0.9.
|
174
|
+
thor (1.1.0)
|
175
|
+
timecop (0.9.4)
|
173
176
|
tzinfo (2.0.4)
|
174
177
|
concurrent-ruby (~> 1.0)
|
175
|
-
websocket-driver (0.7.
|
178
|
+
websocket-driver (0.7.5)
|
176
179
|
websocket-extensions (>= 0.1.0)
|
177
180
|
websocket-extensions (0.1.5)
|
178
181
|
zeitwerk (2.4.2)
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/metka.svg)](https://badge.fury.io/rb/metka)
|
2
|
-
[![Build Status](https://github.com/jetrockets/metka/workflows/
|
2
|
+
[![Build Status](https://github.com/jetrockets/metka/workflows/Specs/badge.svg?branch=master)](https://github.com/jetrockets/metka/actions)
|
3
3
|
[![Open Source Helpers](https://www.codetriage.com/jetrockets/metka/badges/users.svg)](https://www.codetriage.com/jetrockets/metka)
|
4
4
|
|
5
5
|
# Metka
|
@@ -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
|
#=> []
|
@@ -338,6 +353,35 @@ TBD
|
|
338
353
|
2. [ActsAsTaggableArrayOn](https://github.com/tmiyamon/acts-as-taggable-array-on)
|
339
354
|
3. [TagColumns](https://github.com/hopsoft/tag_columns)
|
340
355
|
|
356
|
+
## Migration from ActsAsTaggable
|
357
|
+
|
358
|
+
To migrate your data from `ActsAsTaggable` can be done with the following migration.
|
359
|
+
|
360
|
+
```ruby
|
361
|
+
class AddTagsToYourTable < ActiveRecord::Migration[6.0]
|
362
|
+
def change
|
363
|
+
add_column :your_table, :tags, :string, array: true
|
364
|
+
add_index :your_table, :tags, using: 'gin'
|
365
|
+
|
366
|
+
execute <<~SQL
|
367
|
+
UPDATE your_table
|
368
|
+
SET tags = tags.names
|
369
|
+
FROM (
|
370
|
+
SELECT taggings.taggable_id AS your_table_id,
|
371
|
+
array_agg(tags.name) as names
|
372
|
+
FROM tags
|
373
|
+
INNER JOIN taggings
|
374
|
+
ON tags.id = taggings.tag_id
|
375
|
+
WHERE
|
376
|
+
taggings.taggable_type = 'YouTableType'
|
377
|
+
GROUP BY taggings.taggable_id
|
378
|
+
) as tags
|
379
|
+
WHERE your_table.id = tags.your_table_id
|
380
|
+
SQL
|
381
|
+
end
|
382
|
+
end
|
383
|
+
```
|
384
|
+
|
341
385
|
## Benchmark Comparison
|
342
386
|
|
343
387
|
There are some results of benchmarking a performance of write, read and find operations for different gems, that provide solution for tagging. Keep in mind, that those results can't be used as a proof, that some solution is better than the others, since each of the benchmarked gems has their unique features. You could run the benchmarks yourself or check, what exact operations has been used for benchmarking, with [MetkaBench application](https://github.com/jetrockets/metka_bench).
|
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
data/lib/metka.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.3
|
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-09-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dry-configurable
|
@@ -188,9 +188,9 @@ extensions: []
|
|
188
188
|
extra_rdoc_files: []
|
189
189
|
files:
|
190
190
|
- ".github/ISSUE_TEMPLATE.md"
|
191
|
-
- ".github/workflows/
|
192
|
-
- ".github/workflows/
|
193
|
-
- ".github/workflows/
|
191
|
+
- ".github/workflows/lint_code.yml"
|
192
|
+
- ".github/workflows/lint_docs.yml"
|
193
|
+
- ".github/workflows/specs.yml"
|
194
194
|
- ".gitignore"
|
195
195
|
- ".mdlrc"
|
196
196
|
- ".rspec"
|
@@ -209,7 +209,7 @@ files:
|
|
209
209
|
- gemfiles/rails52.gemfile
|
210
210
|
- gemfiles/rails6.gemfile
|
211
211
|
- gemfiles/rails61.gemfile
|
212
|
-
- gemfiles/
|
212
|
+
- gemfiles/railsmain.gemfile
|
213
213
|
- gemfiles/rubocop.gemfile
|
214
214
|
- lib/generators/metka/strategies/materialized_view/materialized_view_generator.rb
|
215
215
|
- lib/generators/metka/strategies/materialized_view/templates/migration.rb.erb
|