Class: ActsAsTaggableOn::Configuration
- Inherits:
-
Object
- Object
- ActsAsTaggableOn::Configuration
- Defined in:
- lib/acts-as-taggable-on.rb
Instance Attribute Summary collapse
-
#default_parser ⇒ Object
Returns the value of attribute default_parser.
-
#delimiter ⇒ Object
Returns the value of attribute delimiter.
-
#force_lowercase ⇒ Object
Returns the value of attribute force_lowercase.
-
#force_parameterize ⇒ Object
Returns the value of attribute force_parameterize.
-
#remove_unused_tags ⇒ Object
Returns the value of attribute remove_unused_tags.
-
#strict_case_match ⇒ Object
Returns the value of attribute strict_case_match.
-
#tags_counter ⇒ Object
Returns the value of attribute tags_counter.
Class Method Summary collapse
Instance Method Summary collapse
- #force_binary_collation=(force_bin) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
69 70 71 72 73 74 75 76 77 78 |
# File 'lib/acts-as-taggable-on.rb', line 69 def initialize @delimiter = ',' @force_lowercase = false @force_parameterize = false @strict_case_match = false @remove_unused_tags = false @tags_counter = true @default_parser = DefaultParser @force_binary_collation = false end |
Instance Attribute Details
#default_parser ⇒ Object
Returns the value of attribute default_parser.
64 65 66 |
# File 'lib/acts-as-taggable-on.rb', line 64 def default_parser @default_parser end |
#delimiter ⇒ Object
Returns the value of attribute delimiter.
67 68 69 |
# File 'lib/acts-as-taggable-on.rb', line 67 def delimiter @delimiter end |
#force_lowercase ⇒ Object
Returns the value of attribute force_lowercase.
64 65 66 |
# File 'lib/acts-as-taggable-on.rb', line 64 def force_lowercase @force_lowercase end |
#force_parameterize ⇒ Object
Returns the value of attribute force_parameterize.
64 65 66 |
# File 'lib/acts-as-taggable-on.rb', line 64 def force_parameterize @force_parameterize end |
#remove_unused_tags ⇒ Object
Returns the value of attribute remove_unused_tags.
64 65 66 |
# File 'lib/acts-as-taggable-on.rb', line 64 def @remove_unused_tags end |
#strict_case_match ⇒ Object
Returns the value of attribute strict_case_match.
67 68 69 |
# File 'lib/acts-as-taggable-on.rb', line 67 def strict_case_match @strict_case_match end |
#tags_counter ⇒ Object
Returns the value of attribute tags_counter.
64 65 66 |
# File 'lib/acts-as-taggable-on.rb', line 64 def @tags_counter end |
Class Method Details
.apply_binary_collation(bincoll) ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/acts-as-taggable-on.rb', line 106 def self.apply_binary_collation(bincoll) if Utils.using_mysql? coll = 'utf8_general_ci' coll = 'utf8_bin' if bincoll begin ActiveRecord::Migration.execute("ALTER TABLE #{Tag.table_name} MODIFY name varchar(255) CHARACTER SET utf8 COLLATE #{coll};") rescue Exception => e puts "Trapping #{e.class}: collation parameter ignored while migrating for the first time." end end end |
Instance Method Details
#force_binary_collation=(force_bin) ⇒ Object
93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/acts-as-taggable-on.rb', line 93 def force_binary_collation=(force_bin) if Utils.using_mysql? if force_bin Configuration.apply_binary_collation(true) @force_binary_collation = true @strict_case_match = true else Configuration.apply_binary_collation(false) @force_binary_collation = false end end end |