diff options
Diffstat (limited to 'vendor/plugins')
-rw-r--r-- | vendor/plugins/has_tag_string/lib/has_tag_string.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vendor/plugins/has_tag_string/lib/has_tag_string.rb b/vendor/plugins/has_tag_string/lib/has_tag_string.rb index 365ae4b31..fdcc35a55 100644 --- a/vendor/plugins/has_tag_string/lib/has_tag_string.rb +++ b/vendor/plugins/has_tag_string/lib/has_tag_string.rb @@ -29,6 +29,8 @@ module HasTagString return ret end + # Parses a text version of one single tag, such as "a:b" and returns + # the name and value, with nil for value if there isn't one. def HasTagStringTag.split_tag_into_name_value(tag) sections = tag.split(/:/) name = sections[0] @@ -46,6 +48,10 @@ module HasTagString # Given an input string of tags, sets all tags to that string. # XXX This immediately saves the new tags. def tag_string=(tag_string) + if tag_string.nil? + tag_string = "" + end + tag_string = tag_string.strip # split tags apart tags = tag_string.split(/\s+/).uniq |