make_taggable 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -0
- data/Rakefile +3 -0
- data/UPGRADING.md +5 -0
- data/db/migrate/3_change_tag_name_collation_mysql.rb +7 -0
- data/db/migrate/{3_add_index_to_tags.rb → 4_add_index_to_tags.rb} +0 -0
- data/db/migrate/{4_add_index_to_taggings.rb → 5_add_index_to_taggings.rb} +0 -0
- data/lib/make_taggable/taggable/tagged_with_query/query_base.rb +4 -4
- data/lib/make_taggable/tagger.rb +1 -1
- data/lib/make_taggable/tagging.rb +1 -1
- data/lib/make_taggable/version.rb +1 -1
- data/make_taggable.gemspec +5 -1
- data/spec/dummy/db/migrate/{20201119222429_create_make_taggable_tags.make_taggable_engine.rb → 20201121222007_create_make_taggable_tags.make_taggable_engine.rb} +0 -0
- data/spec/dummy/db/migrate/{20201119222430_create_make_taggable_taggings.make_taggable_engine.rb → 20201121222008_create_make_taggable_taggings.make_taggable_engine.rb} +0 -0
- data/spec/dummy/db/migrate/20201121222009_change_tag_name_collation_mysql.make_taggable_engine.rb +8 -0
- data/spec/dummy/db/migrate/{20201119222431_add_index_to_tags.make_taggable_engine.rb → 20201121222010_add_index_to_tags.make_taggable_engine.rb} +1 -1
- data/spec/dummy/db/migrate/{20201119222432_add_index_to_taggings.make_taggable_engine.rb → 20201121222011_add_index_to_taggings.make_taggable_engine.rb} +1 -1
- data/spec/dummy/db/schema.rb +1 -1
- data/spec/make_taggable/taggable_spec.rb +1 -1
- metadata +24 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc110297a0bf19db2784546646da17f6ae73dc9f359383ae06e1d3502544474a
|
4
|
+
data.tar.gz: efa71fe953279fd9a1e16b064faff9f3eb24551759b9657b6db112b11e32f241
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee09cc7eb170007245f4d7e4c072699cdeadca15700deb5d356bfe1724d52d04bb0ee6e095845a2d05b9889dfd44e5a384de87cd301c5fa287f010ed901fa6cc
|
7
|
+
data.tar.gz: 5f443267e9ee6db3666ebc03dab51b89f41291ba5122cb040a29c3f73f7fdcd0b99fff04d772bb31537bf7760bdf2b0919fcbc371327acf8ec0a1a0e8f8e9ac9
|
data/README.md
CHANGED
@@ -37,6 +37,21 @@ Review the generated migrations then migrate :
|
|
37
37
|
rails db:migrate
|
38
38
|
```
|
39
39
|
|
40
|
+
#### For MySql users
|
41
|
+
You can circumvent at any time the problem of special characters [issue 623](https://github.com/mbleigh/acts-as-taggable-on/issues/623) by setting in an initializer file:
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
MakeTaggable.force_binary_collation = true
|
45
|
+
```
|
46
|
+
|
47
|
+
Or by running this rake task:
|
48
|
+
|
49
|
+
```shell
|
50
|
+
rails make_taggable_on_engine:tag_names:collate_bin
|
51
|
+
```
|
52
|
+
|
53
|
+
See the Configuration section for more details.
|
54
|
+
|
40
55
|
## Usage
|
41
56
|
|
42
57
|
Setup
|
data/Rakefile
CHANGED
data/UPGRADING.md
ADDED
File without changes
|
File without changes
|
@@ -29,9 +29,9 @@ module MakeTaggable::Taggable::TaggedWithQuery
|
|
29
29
|
matches_attribute = matches_attribute.lower unless MakeTaggable.strict_case_match
|
30
30
|
|
31
31
|
if options[:wild].present?
|
32
|
-
matches_attribute.matches("%#{escaped_tag(tag)}%", "!")
|
32
|
+
matches_attribute.matches("%#{escaped_tag(tag)}%", "!", MakeTaggable.strict_case_match)
|
33
33
|
else
|
34
|
-
matches_attribute.matches(escaped_tag(tag), "!")
|
34
|
+
matches_attribute.matches(escaped_tag(tag), "!", MakeTaggable.strict_case_match)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -40,9 +40,9 @@ module MakeTaggable::Taggable::TaggedWithQuery
|
|
40
40
|
matches_attribute = matches_attribute.lower unless MakeTaggable.strict_case_match
|
41
41
|
|
42
42
|
if options[:wild].present?
|
43
|
-
matches_attribute.matches_any(tag_list.map { |tag| "%#{escaped_tag(tag)}%" }, "!")
|
43
|
+
matches_attribute.matches_any(tag_list.map { |tag| "%#{escaped_tag(tag)}%" }, "!", MakeTaggable.strict_case_match)
|
44
44
|
else
|
45
|
-
matches_attribute.matches_any(tag_list.map { |tag| escaped_tag(tag).to_s }, "!")
|
45
|
+
matches_attribute.matches_any(tag_list.map { |tag| escaped_tag(tag).to_s }, "!", MakeTaggable.strict_case_match)
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
data/lib/make_taggable/tagger.rb
CHANGED
@@ -6,7 +6,7 @@ module MakeTaggable
|
|
6
6
|
belongs_to :tag, class_name: "::MakeTaggable::Tag", counter_cache: MakeTaggable.tags_counter
|
7
7
|
belongs_to :taggable, polymorphic: true
|
8
8
|
|
9
|
-
belongs_to :tagger,
|
9
|
+
belongs_to :tagger, polymorphic: true, optional: true
|
10
10
|
|
11
11
|
scope :owned_by, ->(owner) { where(tagger: owner) }
|
12
12
|
scope :not_owned, -> { where(tagger_id: nil, tagger_type: nil) }
|
data/make_taggable.gemspec
CHANGED
@@ -7,11 +7,15 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.version = MakeTaggable::VERSION
|
8
8
|
spec.authors = ["Matthew Kennedy", "Michael Bleigh", "Joost Baaij"]
|
9
9
|
spec.email = %w[m.kennedy@me.com michael@intridea.com joost@spacebabies.nl]
|
10
|
-
spec.description = "
|
10
|
+
spec.description = "A fork of acts-as-taggable-on v6.5 with code updates and a new set of migrations."
|
11
11
|
spec.summary = "Advanced Tagging For Rails"
|
12
12
|
spec.homepage = "https://github.com/MatthewKennedy/make_taggable"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
15
|
+
if File.exist?('UPGRADING.md')
|
16
|
+
spec.post_install_message = File.read('UPGRADING.md')
|
17
|
+
end
|
18
|
+
|
15
19
|
spec.files = `git ls-files`.split($/)
|
16
20
|
spec.test_files = spec.files.grep(%r{^spec/})
|
17
21
|
spec.require_paths = ["lib"]
|
File without changes
|
File without changes
|
data/spec/dummy/db/migrate/20201121222009_change_tag_name_collation_mysql.make_taggable_engine.rb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
# This migration comes from make_taggable_engine (originally 3)
|
2
|
+
class ChangeTagNameCollationMysql < ActiveRecord::Migration[5.2]
|
3
|
+
def change
|
4
|
+
if MakeTaggable::Utils.using_mysql?
|
5
|
+
execute("ALTER TABLE #{MakeTaggable.tags_table} MODIFY name varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;")
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema.define(version:
|
13
|
+
ActiveRecord::Schema.define(version: 2020_11_21_222011) do
|
14
14
|
|
15
15
|
create_table "cache_methods_injected_models", force: :cascade do |t|
|
16
16
|
t.string "cached_tag_list"
|
@@ -474,7 +474,7 @@ describe "Taggable" do
|
|
474
474
|
|
475
475
|
expect(TaggableModel.tagged_with(%w[bob tricia], wild: true, any: true).to_a.sort_by { |o| o.id }).to eq([bob, frank, steve])
|
476
476
|
expect(TaggableModel.tagged_with(%w[bob tricia], wild: true, exclude: true).to_a).to eq([jim])
|
477
|
-
expect(TaggableModel.tagged_with(
|
477
|
+
expect(TaggableModel.tagged_with('ji', wild: true, any: true).to_a).to match_array([frank, jim])
|
478
478
|
end
|
479
479
|
end
|
480
480
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: make_taggable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Kennedy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-11-
|
13
|
+
date: 2020-11-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -96,8 +96,8 @@ dependencies:
|
|
96
96
|
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
|
-
description:
|
100
|
-
|
99
|
+
description: A fork of acts-as-taggable-on v6.5 with code updates and a new set of
|
100
|
+
migrations.
|
101
101
|
email:
|
102
102
|
- m.kennedy@me.com
|
103
103
|
- michael@intridea.com
|
@@ -121,12 +121,14 @@ files:
|
|
121
121
|
- LICENSE.txt
|
122
122
|
- README.md
|
123
123
|
- Rakefile
|
124
|
+
- UPGRADING.md
|
124
125
|
- bin/console
|
125
126
|
- bin/setup
|
126
127
|
- db/migrate/1_create_make_taggable_tags.rb
|
127
128
|
- db/migrate/2_create_make_taggable_taggings.rb
|
128
|
-
- db/migrate/
|
129
|
-
- db/migrate/
|
129
|
+
- db/migrate/3_change_tag_name_collation_mysql.rb
|
130
|
+
- db/migrate/4_add_index_to_tags.rb
|
131
|
+
- db/migrate/5_add_index_to_taggings.rb
|
130
132
|
- gemfiles/rails_5.gemfile
|
131
133
|
- gemfiles/rails_6.gemfile
|
132
134
|
- gemfiles/rails_master.gemfile
|
@@ -222,10 +224,11 @@ files:
|
|
222
224
|
- spec/dummy/db/migrate/20201119221530_create_cache_methods_injected_models.rb
|
223
225
|
- spec/dummy/db/migrate/20201119221629_create_other_cached_with_array_models.rb
|
224
226
|
- spec/dummy/db/migrate/20201119221746_create_taggable_model_with_jsons.rb
|
225
|
-
- spec/dummy/db/migrate/
|
226
|
-
- spec/dummy/db/migrate/
|
227
|
-
- spec/dummy/db/migrate/
|
228
|
-
- spec/dummy/db/migrate/
|
227
|
+
- spec/dummy/db/migrate/20201121222007_create_make_taggable_tags.make_taggable_engine.rb
|
228
|
+
- spec/dummy/db/migrate/20201121222008_create_make_taggable_taggings.make_taggable_engine.rb
|
229
|
+
- spec/dummy/db/migrate/20201121222009_change_tag_name_collation_mysql.make_taggable_engine.rb
|
230
|
+
- spec/dummy/db/migrate/20201121222010_add_index_to_tags.make_taggable_engine.rb
|
231
|
+
- spec/dummy/db/migrate/20201121222011_add_index_to_taggings.make_taggable_engine.rb
|
229
232
|
- spec/dummy/db/schema.rb
|
230
233
|
- spec/dummy/db/seeds.rb
|
231
234
|
- spec/dummy/lib/tasks/.keep
|
@@ -264,7 +267,12 @@ homepage: https://github.com/MatthewKennedy/make_taggable
|
|
264
267
|
licenses:
|
265
268
|
- MIT
|
266
269
|
metadata: {}
|
267
|
-
post_install_message:
|
270
|
+
post_install_message: |
|
271
|
+
When upgrading run the migrations generator
|
272
|
+
|
273
|
+
rake acts_as_taggable_on_engine:install:migrations
|
274
|
+
|
275
|
+
This will create any new migrations and skip existing ones
|
268
276
|
rdoc_options: []
|
269
277
|
require_paths:
|
270
278
|
- lib
|
@@ -351,10 +359,11 @@ test_files:
|
|
351
359
|
- spec/dummy/db/migrate/20201119221530_create_cache_methods_injected_models.rb
|
352
360
|
- spec/dummy/db/migrate/20201119221629_create_other_cached_with_array_models.rb
|
353
361
|
- spec/dummy/db/migrate/20201119221746_create_taggable_model_with_jsons.rb
|
354
|
-
- spec/dummy/db/migrate/
|
355
|
-
- spec/dummy/db/migrate/
|
356
|
-
- spec/dummy/db/migrate/
|
357
|
-
- spec/dummy/db/migrate/
|
362
|
+
- spec/dummy/db/migrate/20201121222007_create_make_taggable_tags.make_taggable_engine.rb
|
363
|
+
- spec/dummy/db/migrate/20201121222008_create_make_taggable_taggings.make_taggable_engine.rb
|
364
|
+
- spec/dummy/db/migrate/20201121222009_change_tag_name_collation_mysql.make_taggable_engine.rb
|
365
|
+
- spec/dummy/db/migrate/20201121222010_add_index_to_tags.make_taggable_engine.rb
|
366
|
+
- spec/dummy/db/migrate/20201121222011_add_index_to_taggings.make_taggable_engine.rb
|
358
367
|
- spec/dummy/db/schema.rb
|
359
368
|
- spec/dummy/db/seeds.rb
|
360
369
|
- spec/dummy/lib/tasks/.keep
|