Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not apply binary collation every time on rails boot for MySQL users #977

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions lib/acts-as-taggable-on.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,13 @@ 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
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
Expand Down