This repository has been archived by the owner on Mar 19, 2021. It is now read-only.
forked from mbleigh/acts-as-taggable-on
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added rake rule and a config parameter to force binary collation (MySql)
added migration and rake task added rake rule and a config parameter to force binary collation (MySql) Added test for binary string collation included migration in test added self to migration moved binary collation migration to 'without unique index' context moved binary collation parameter from migration to app configuration (typo) removed import (typo) missing Configuration class name force_binary_collation change can be set by MySql users only (typo) method name using_mysql? when force_binary_collation is false, strict_case_match is not touch force_binary_collation not used in context without_unique_index updated README and simplified rake test rake task calls Configuration function updated README Gemfile cleaned cleaned READEME.md Added test for binary string collation (typo) removed import (typo) method name using_mysql? when force_binary_collation is false, strict_case_match is not touch force_binary_collation not used in context without_unique_index Gemfile cleaned updated CHANGELOG added migration and rake task Add context constraint to find_related_* methods. Fixes mbleigh#628 version bump added rake rule and a config parameter to force binary collation (MySql) added rake rule and a config parameter to force binary collation (MySql) applied changes added migration and rake task
- Loading branch information
Showing
8 changed files
with
107 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ group :local_development do | |
gem 'appraisal' | ||
gem 'rake' | ||
gem 'byebug' , platform: :mri_21 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This migration is added to circumvent issue #623 and have special characters | ||
# work properly | ||
class ChangeCollationForTagNames << ActiveRecord::Migration | ||
|
||
def up | ||
if ActsAsTaggableOn::Utils.using_mysql? | ||
execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;") | ||
end | ||
end | ||
|
||
def down | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# These rake tasks are to be run by MySql users only, they fix the management of | ||
# binary-encoded strings for tag 'names'. Issues: | ||
# https://github.com/mbleigh/acts-as-taggable-on/issues/623 | ||
|
||
namespace :acts_as_taggable_on_engine do | ||
|
||
namespace :tag_names do | ||
|
||
desc "Forcing collate of tag names to utf8_bin" | ||
task :collate_bin => [:environment] do |t, args| | ||
ActsAsTaggableOn::Configuration.apply_binary_collation(true) | ||
end | ||
|
||
desc "Forcing collate of tag names to utf8_general_ci" | ||
task :collate_ci => [:environment] do |t, args| | ||
ActsAsTaggableOn::Configuration.apply_binary_collation(false) | ||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters