# File lib/taggable.rb, line 556
        def tag(tags, options = {})
      
          options = { :separator => ' ', :clear => false }.merge(options)
          attributes = options[:attributes] || {}     
          
          # parse the tags parameter
          tag_names = ActiveRecord::Acts::Taggable.split_tag_names(tags, options[:separator], normalizer)
          
          # clear the collection if appropriate
          self.clear_tags! if options[:clear]
      
          # append the tag names to the collection
          tag_names.each do |name| 
            # ensure that tag names don't get duplicated           
            tag_record = tag_model.find(:first, :conditions=>["#{tag_model_name} = ?",name]) || tag_model.new(tag_model_name.to_sym => name)
            if tags_join_model
              tag_join_record = tags_join_model.new(attributes)
              tag_join_record.tag = tag_record
              tag_join_record.tagged = self
              tag_collection << tag_join_record unless tagged_with?(name)
            else
              tag_collection.push_with_attributes(tag_record, attributes) unless tagged_with?(name)
            end
          end
          
        end