mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-24 17:56:10 +01:00
another set of dynamic finder migrations. All non-cucumber tests pass
This commit is contained in:
parent
64a198d45a
commit
ef91dd0c64
18 changed files with 66 additions and 66 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue