Created
May 14, 2009 16:43
-
-
Save myobie/111750 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/vendor/plugins/is_taggable/lib/is_taggable.rb b/vendor/plugins/is_taggable/lib/is_taggable.rb | |
index ba2f9a2..5f9e6ae 100644 | |
--- a/vendor/plugins/is_taggable/lib/is_taggable.rb | |
+++ b/vendor/plugins/is_taggable/lib/is_taggable.rb | |
@@ -9,7 +9,7 @@ module IsTaggable | |
@@delimiter = ',' | |
def initialize(list) | |
- list = list.is_a?(Array) ? list : list.split(@@delimiter).collect(&:strip) | |
+ list = list.is_a?(Array) ? list : list.split(@@delimiter).collect(&:strip).reject(&:blank?) | |
super | |
end | |
diff --git a/vendor/plugins/is_taggable/test/is_taggable_test.rb b/vendor/plugins/is_taggable/test/is_taggable_test.rb | |
index 34c85be..7d3fae5 100644 | |
--- a/vendor/plugins/is_taggable/test/is_taggable_test.rb | |
+++ b/vendor/plugins/is_taggable/test/is_taggable_test.rb | |
@@ -62,6 +62,14 @@ Expectations do | |
p.tags.reload | |
p.tag_list | |
end | |
+ | |
+ expect ["blank","topics","should be ignored"] do | |
+ p = Post.new | |
+ p.tag_list = "blank, topics, should be ignored, " | |
+ p.save! | |
+ p.tags.reload | |
+ p.tag_list | |
+ end | |
expect 2 do | |
p = Post.new :language_list => "english, french" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment