diff --git a/lib/acts_as_taggable_on/acts_as_taggable_on/core.rb b/lib/acts_as_taggable_on/acts_as_taggable_on/core.rb index 1d32b375c..fa25c9adc 100644 --- a/lib/acts_as_taggable_on/acts_as_taggable_on/core.rb +++ b/lib/acts_as_taggable_on/acts_as_taggable_on/core.rb @@ -307,7 +307,7 @@ def tagging_contexts end def process_dirty_object(context,new_list) - value = new_list.is_a?(Array) ? new_list.join(', ') : new_list + value = new_list.is_a?(Array) ? ActsAsTaggableOn::TagList.new(new_list) : new_list attrib = "#{context.to_s.singularize}_list" if changed_attributes.include?(attrib) diff --git a/spec/acts_as_taggable_on/taggable_spec.rb b/spec/acts_as_taggable_on/taggable_spec.rb index bb919df6a..851a31819 100644 --- a/spec/acts_as_taggable_on/taggable_spec.rb +++ b/spec/acts_as_taggable_on/taggable_spec.rb @@ -562,6 +562,22 @@ it 'does not show any changes to the taggable item' do @taggable.changes.should == {} end + + context "and using a delimiter different from a ','" do + before do + @old_delimiter = ActsAsTaggableOn.delimiter + ActsAsTaggableOn.delimiter = ';' + end + + after do + ActsAsTaggableOn.delimiter = @old_delimiter + end + + it 'does not show any changes to the taggable item when using array assignments' do + @taggable.tag_list = ["awesome", "epic"] + @taggable.changes.should == {} + end + end end end