another set of dynamic finder migrations. All non-cucumber tests pass

This commit is contained in:
Reinier Balt 2013-02-27 11:50:49 +01:00
parent 64a198d45a
commit ef91dd0c64
18 changed files with 66 additions and 66 deletions

View file

@ -51,7 +51,7 @@ module IsTaggable
# added following check to prevent empty tags from being saved (which will fail)
unless tag_name.blank?
begin
tag = Tag.find_or_create_by_name(tag_name)
tag = Tag.where(:name => tag_name).first_or_create
raise Tag::Error, "tag could not be saved: #{tag_name}" if tag.new_record?
tags << tag
rescue ActiveRecord::StatementInvalid => e