This repository was archived by the owner on Oct 5, 2021. It is now read-only.
This repository was archived by the owner on Oct 5, 2021. It is now read-only.
disallow duplicates for tags on the front end #41
Open
Description
So that we can avoid errors like this:
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_tags_on_name"
DETAIL: Key (name)=(marketing) already exists.
+ 79 non-project frames
80
File "/usr/local/bundle/gems/aleph_analytics-0.0.6/lib/interaction/query_update.rb" line 42 in execute
81
File "/usr/local/bundle/gems/aleph_analytics-0.0.6/app/controllers/queries_controller.rb" line 44 in block (2 levels) in update
+ 2 non-project frames
84
File "/usr/local/bundle/gems/aleph_analytics-0.0.6/app/controllers/queries_controller.rb" line 41 in update
+ 80 non-project frames
ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_tags_on_name"
DETAIL: Key (name)=(marketing) already exists.
: INSERT INTO "tags" ("name") VALUES ($1) RETURNING "id"
+ 79 non-project frames
80
File "/usr/local/bundle/gems/aleph_analytics-0.0.6/lib/interaction/query_update.rb" line 42 in execute
81
File "/usr/local/bundle/gems/aleph_analytics-0.0.6/app/controllers/queries_controller.rb" line 44 in block (2 levels) in update
+ 2 non-project frames
84
File "/usr/local/bundle/gems/aleph_analytics-0.0.6/app/controllers/queries_controller.rb" line 41 in update
+ 80 non-project frames
ActsAsTaggableOn::DuplicateTagError: 'marketing' has already been taken
- 32 non-project frames