metka 2.3.0 → 2.3.1
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 +82 -79
- data/README.md +30 -1
- data/gemfiles/{railsmaster.gemfile → railsmain.gemfile} +1 -1
- data/lib/metka/version.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: a797dd1f5463da09cc8557a9fafe6351ef8a99caa810ab7f9c3193af424eb080
|
4
|
+
data.tar.gz: dd3524033fc92df97a2e2f7c9c4730005c01d9786f384dd846586c63b57d205c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09ffcb13bd0856fee54d9ab6e03c9f9dfc2d43bacf4dbf0b9d7aac1e6a0515b280c0ad2694f878cabc9c2be64227f60a8835f3a83406ceae6d1d19cf4460864f'
|
7
|
+
data.tar.gz: 4624b4eb0de21a81b60ae6bf2e747c6e48c039e03a07ae20a3323c6933e84cb8f7c2aaf5d4687b8e14f448aa1b64abc00ebe87172e72eae731614c8d10c8e36d
|
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,141 +1,144 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
metka (2.
|
4
|
+
metka (2.3.1)
|
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.3.1)
|
12
|
+
actionpack (= 6.1.3.1)
|
13
|
+
activesupport (= 6.1.3.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.3.1)
|
17
|
+
actionpack (= 6.1.3.1)
|
18
|
+
activejob (= 6.1.3.1)
|
19
|
+
activerecord (= 6.1.3.1)
|
20
|
+
activestorage (= 6.1.3.1)
|
21
|
+
activesupport (= 6.1.3.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.3.1)
|
24
|
+
actionpack (= 6.1.3.1)
|
25
|
+
actionview (= 6.1.3.1)
|
26
|
+
activejob (= 6.1.3.1)
|
27
|
+
activesupport (= 6.1.3.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.3.1)
|
31
|
+
actionview (= 6.1.3.1)
|
32
|
+
activesupport (= 6.1.3.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.3.1)
|
38
|
+
actionpack (= 6.1.3.1)
|
39
|
+
activerecord (= 6.1.3.1)
|
40
|
+
activestorage (= 6.1.3.1)
|
41
|
+
activesupport (= 6.1.3.1)
|
42
42
|
nokogiri (>= 1.8.5)
|
43
|
-
actionview (6.1.
|
44
|
-
activesupport (= 6.1.
|
43
|
+
actionview (6.1.3.1)
|
44
|
+
activesupport (= 6.1.3.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.3.1)
|
50
|
+
activesupport (= 6.1.3.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.3.1)
|
53
|
+
activesupport (= 6.1.3.1)
|
54
|
+
activerecord (6.1.3.1)
|
55
|
+
activemodel (= 6.1.3.1)
|
56
|
+
activesupport (= 6.1.3.1)
|
57
|
+
activestorage (6.1.3.1)
|
58
|
+
actionpack (= 6.1.3.1)
|
59
|
+
activejob (= 6.1.3.1)
|
60
|
+
activerecord (= 6.1.3.1)
|
61
|
+
activesupport (= 6.1.3.1)
|
62
|
+
marcel (~> 1.0.0)
|
63
|
+
mini_mime (~> 1.0.2)
|
64
|
+
activesupport (6.1.3.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.8)
|
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.12.
|
85
|
+
dry-configurable (0.12.1)
|
81
86
|
concurrent-ruby (~> 1.0)
|
82
87
|
dry-core (~> 0.5, >= 0.5.0)
|
83
88
|
dry-core (0.5.0)
|
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
93
|
globalid (0.4.2)
|
89
94
|
activesupport (>= 4.2.0)
|
90
|
-
i18n (1.8.
|
95
|
+
i18n (1.8.10)
|
91
96
|
concurrent-ruby (~> 1.0)
|
92
|
-
loofah (2.
|
97
|
+
loofah (2.9.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.0)
|
99
103
|
method_source (1.0.0)
|
100
|
-
|
101
|
-
mini_mime (1.0.2)
|
104
|
+
mini_mime (1.0.3)
|
102
105
|
mini_portile2 (2.5.0)
|
103
|
-
minitest (5.14.
|
104
|
-
nio4r (2.5.
|
105
|
-
nokogiri (1.11.
|
106
|
+
minitest (5.14.4)
|
107
|
+
nio4r (2.5.7)
|
108
|
+
nokogiri (1.11.2)
|
106
109
|
mini_portile2 (~> 2.5.0)
|
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.3.1)
|
120
|
+
actioncable (= 6.1.3.1)
|
121
|
+
actionmailbox (= 6.1.3.1)
|
122
|
+
actionmailer (= 6.1.3.1)
|
123
|
+
actionpack (= 6.1.3.1)
|
124
|
+
actiontext (= 6.1.3.1)
|
125
|
+
actionview (= 6.1.3.1)
|
126
|
+
activejob (= 6.1.3.1)
|
127
|
+
activemodel (= 6.1.3.1)
|
128
|
+
activerecord (= 6.1.3.1)
|
129
|
+
activestorage (= 6.1.3.1)
|
130
|
+
activesupport (= 6.1.3.1)
|
128
131
|
bundler (>= 1.15.0)
|
129
|
-
railties (= 6.1.
|
132
|
+
railties (= 6.1.3.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
137
|
rails-html-sanitizer (1.3.0)
|
135
138
|
loofah (~> 2.3)
|
136
|
-
railties (6.1.
|
137
|
-
actionpack (= 6.1.
|
138
|
-
activesupport (= 6.1.
|
139
|
+
railties (6.1.3.1)
|
140
|
+
actionpack (= 6.1.3.1)
|
141
|
+
activesupport (= 6.1.3.1)
|
139
142
|
method_source
|
140
143
|
rake (>= 0.8.7)
|
141
144
|
thor (~> 1.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,8 +171,8 @@ 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
178
|
websocket-driver (0.7.3)
|
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
|
@@ -353,6 +353,35 @@ TBD
|
|
353
353
|
2. [ActsAsTaggableArrayOn](https://github.com/tmiyamon/acts-as-taggable-array-on)
|
354
354
|
3. [TagColumns](https://github.com/hopsoft/tag_columns)
|
355
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
|
+
|
356
385
|
## Benchmark Comparison
|
357
386
|
|
358
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/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.3.
|
4
|
+
version: 2.3.1
|
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-04-01 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
|