From de5541013f3eb99a7877f676a2ea50224ae8a26e Mon Sep 17 00:00:00 2001 From: chris Date: Wed, 2 Oct 2013 18:36:08 +0800 Subject: [PATCH] Fix tag to remove ['0', '1'] from the form --- lib/orbit_tag/taggable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/orbit_tag/taggable.rb b/lib/orbit_tag/taggable.rb index 7a52f5f0f..cadf2ad60 100644 --- a/lib/orbit_tag/taggable.rb +++ b/lib/orbit_tag/taggable.rb @@ -46,7 +46,7 @@ module OrbitTag def tags=(tag_ids) tag_ids = [tag_ids].flatten - tag_ids.delete('') + tag_ids.delete_if{|e| e.match(/^[0-1]$|^$/)} ids = self.taggings.blank? ? [] : self.taggings.map{|t| t.tag.id} tag_ids.each do |tag_id| unless ids.include? tag_id