Class: ActsAsTaggableOn::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/acts-as-taggable-on.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



64
65
66
67
68
69
70
71
72
73
# File 'lib/acts-as-taggable-on.rb', line 64

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_parserObject

Returns the value of attribute default_parser.



60
61
62
# File 'lib/acts-as-taggable-on.rb', line 60

def default_parser
  @default_parser
end

#delimiterObject

Returns the value of attribute delimiter.



60
61
62
# File 'lib/acts-as-taggable-on.rb', line 60

def delimiter
  @delimiter
end

#force_lowercaseObject

Returns the value of attribute force_lowercase.



60
61
62
# File 'lib/acts-as-taggable-on.rb', line 60

def force_lowercase
  @force_lowercase
end

#force_parameterizeObject

Returns the value of attribute force_parameterize.



60
61
62
# File 'lib/acts-as-taggable-on.rb', line 60

def force_parameterize
  @force_parameterize
end

#remove_unused_tagsObject

Returns the value of attribute remove_unused_tags.



60
61
62
# File 'lib/acts-as-taggable-on.rb', line 60

def remove_unused_tags
  @remove_unused_tags
end

#strict_case_matchObject

Returns the value of attribute strict_case_match.



60
61
62
# File 'lib/acts-as-taggable-on.rb', line 60

def strict_case_match
  @strict_case_match
end

#tags_counterObject

Returns the value of attribute tags_counter.



60
61
62
# File 'lib/acts-as-taggable-on.rb', line 60

def tags_counter
  @tags_counter
end

Class Method Details

.apply_binary_collation(bincoll) ⇒ Object



103
104
105
106
107
108
109
110
111
# File 'lib/acts-as-taggable-on.rb', line 103

def self.apply_binary_collation(bincoll)
  if Utils.using_mysql?
    coll = 'utf8_general_ci'
    if bincoll == true
      coll = 'utf8_bin'
    end
    ActiveRecord::Migration.execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE #{coll};")
  end
end

Instance Method Details

#force_binary_collation=(force_bin) ⇒ Object



90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/acts-as-taggable-on.rb', line 90

def force_binary_collation=(force_bin)
  if Utils.using_mysql?
    if force_bin == true
      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