From 88c1f955e62850d136e92c6901357294586785bb Mon Sep 17 00:00:00 2001 From: shawnali63 <56575251+shawnali63@users.noreply.github.com> Date: Thu, 21 Nov 2019 12:52:03 +0500 Subject: [PATCH 1/3] Do not apply binary collation every time on boot --- lib/acts-as-taggable-on.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/acts-as-taggable-on.rb b/lib/acts-as-taggable-on.rb index 3e6a6d9d3..b6d53d19e 100644 --- a/lib/acts-as-taggable-on.rb +++ b/lib/acts-as-taggable-on.rb @@ -97,7 +97,8 @@ def delimiter=(string) def force_binary_collation=(force_bin) if Utils.using_mysql? if force_bin - Configuration.apply_binary_collation(true) + # This script should be executed only once not every time when rails is booted. + # Configuration.apply_binary_collation(true) @force_binary_collation = true @strict_case_match = true else From d6f3fc6f8e79ed878cb2213c501f7a8aee43c7df Mon Sep 17 00:00:00 2001 From: shawnali63 <56575251+shawnali63@users.noreply.github.com> Date: Thu, 21 Nov 2019 14:00:26 +0500 Subject: [PATCH 2/3] Update Readme for MySQL collation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d745e557..522205c88 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ You can circumvent at any time the problem of special characters [issue 623](htt ActsAsTaggableOn.force_binary_collation = true ``` -Or by running this rake task: +If `utf8_bin` collation is not aleady set on `name` column in your schema then make sure to set by re-running migration generator or run this rake task: ```shell rake acts_as_taggable_on_engine:tag_names:collate_bin From 844ac337130bb49ae448733e20e5d017a2d6c811 Mon Sep 17 00:00:00 2001 From: shawnali63 <56575251+shawnali63@users.noreply.github.com> Date: Thu, 21 Nov 2019 14:20:12 +0500 Subject: [PATCH 3/3] Do not unset collation on every boot --- lib/acts-as-taggable-on.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/acts-as-taggable-on.rb b/lib/acts-as-taggable-on.rb index b6d53d19e..25281b5c0 100644 --- a/lib/acts-as-taggable-on.rb +++ b/lib/acts-as-taggable-on.rb @@ -102,7 +102,8 @@ def force_binary_collation=(force_bin) @force_binary_collation = true @strict_case_match = true else - Configuration.apply_binary_collation(false) + # TODO: Add rake task to unset binary collation on db + # Configuration.apply_binary_collation(false) @force_binary_collation = false end end