class ActsAsTaggableOn::Configuration

Attributes

base_class[R]
default_parser[RW]
delimiter[R]
force_lowercase[RW]
force_parameterize[RW]
remove_unused_tags[RW]
strict_case_match[R]
taggings_table[RW]
tags_counter[RW]
tags_table[RW]

Public Class Methods

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

Public Instance Methods

base_class=(base_class) click to toggle source
# File lib/acts-as-taggable-on.rb, line 101
def base_class=(base_class)
  raise "base_class must be a String" unless base_class.is_a?(String)
  @base_class = base_class
end
delimiter=(string) click to toggle source
# File lib/acts-as-taggable-on.rb, line 67
    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 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
strict_case_match=(force_cs) click to toggle source
# File lib/acts-as-taggable-on.rb, line 63
def strict_case_match=(force_cs)
  @strict_case_match = force_cs unless @force_binary_collation
end