Merge pull request #206 from mmozuras/refactor_unless_blanks_into_presents

Refactor unless blanks into presents
This commit is contained in:
Reinier Balt 2013-09-13 06:08:16 -07:00
commit e2eb31cfcc
15 changed files with 25 additions and 25 deletions

View file

@ -49,7 +49,7 @@ module IsTaggable
def _add_tags incoming
tag_cast_to_string(incoming).each do |tag_name|
# added following check to prevent empty tags from being saved (which will fail)
unless tag_name.blank?
if tag_name.present?
begin
tag = Tag.where(:name => tag_name).first_or_create
raise Tag::Error, "tag could not be saved: #{tag_name}" if tag.new_record?