Module: Tags
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/concerns/tags.rb
Instance Method Summary collapse
Instance Method Details
#update_tags! ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/models/concerns/tags.rb', line 13 def unless tag_list.nil? self. = [] = [] tag_list.split(',').each do |name| name.strip! if !.include?(name) && name.present? << name tag = Tag.where(:ci_name => name.downcase).first if tag.nil? tag = Tag.create(:name => name) else tag.update(:name => name) unless name == tag.name end self. << tag end end end end |