Class: ActsAsTaggableOn::Configuration
- Inherits:
-
Object
- Object
- ActsAsTaggableOn::Configuration
- Defined in:
- lib/acts-as-taggable-on.rb
Instance Attribute Summary collapse
-
#base_class ⇒ Object
Returns the value of attribute base_class.
-
#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.
-
#taggings_table ⇒ Object
Returns the value of attribute taggings_table.
-
#tags_counter ⇒ Object
Returns the value of attribute tags_counter.
-
#tags_table ⇒ Object
Returns the value of attribute tags_table.
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.
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/acts-as-taggable-on.rb', line 49 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 @tags_table = :tags @taggings_table = :taggings @base_class = '::ActiveRecord::Base' end |
Instance Attribute Details
#base_class ⇒ Object
Returns the value of attribute base_class.
47 48 49 |
# File 'lib/acts-as-taggable-on.rb', line 47 def base_class @base_class end |
#default_parser ⇒ Object
Returns the value of attribute default_parser.
43 44 45 |
# File 'lib/acts-as-taggable-on.rb', line 43 def default_parser @default_parser end |
#delimiter ⇒ Object
Returns the value of attribute delimiter.
47 48 49 |
# File 'lib/acts-as-taggable-on.rb', line 47 def delimiter @delimiter end |
#force_lowercase ⇒ Object
Returns the value of attribute force_lowercase.
43 44 45 |
# File 'lib/acts-as-taggable-on.rb', line 43 def force_lowercase @force_lowercase end |
#force_parameterize ⇒ Object
Returns the value of attribute force_parameterize.
43 44 45 |
# File 'lib/acts-as-taggable-on.rb', line 43 def force_parameterize @force_parameterize end |
#remove_unused_tags ⇒ Object
Returns the value of attribute remove_unused_tags.
43 44 45 |
# File 'lib/acts-as-taggable-on.rb', line 43 def @remove_unused_tags end |
#strict_case_match ⇒ Object
Returns the value of attribute strict_case_match.
47 48 49 |
# File 'lib/acts-as-taggable-on.rb', line 47 def strict_case_match @strict_case_match end |
#taggings_table ⇒ Object
Returns the value of attribute taggings_table.
43 44 45 |
# File 'lib/acts-as-taggable-on.rb', line 43 def taggings_table @taggings_table end |
#tags_counter ⇒ Object
Returns the value of attribute tags_counter.
43 44 45 |
# File 'lib/acts-as-taggable-on.rb', line 43 def @tags_counter end |
#tags_table ⇒ Object
Returns the value of attribute tags_table.
43 44 45 |
# File 'lib/acts-as-taggable-on.rb', line 43 def @tags_table end |
Class Method Details
.apply_binary_collation(bincoll) ⇒ Object
89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/acts-as-taggable-on.rb', line 89 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
76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/acts-as-taggable-on.rb', line 76 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 |