class ActsAsTaggableOn::Configuration

Attributes

default_parser[RW]
delimiter[R]
force_lowercase[RW]
force_parameterize[RW]
remove_unused_tags[RW]
strict_case_match[R]
tags_counter[RW]

Public Class Methods

apply_binary_collation(bincoll) click to toggle source
# 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
new() click to toggle source
# 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

Public Instance Methods

delimiter=(string) click to toggle source
# File lib/acts-as-taggable-on.rb, line 84
    def delimiter=(string)
      ActiveRecord::Base.logger.warn <<WARNING
ActsAsTaggableOn.delimiter is deprecated \
and will be removed from v4.0+, use  \
a ActsAsTaggableOn.default_parser instead
WARNING
      @delimiter = string
    end
force_binary_collation=(force_bin) click to toggle source
# 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
strict_case_match=(force_cs) click to toggle source
# File lib/acts-as-taggable-on.rb, line 80
def strict_case_match=(force_cs)
  @strict_case_match = force_cs unless @force_binary_collation
end