aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZog2018-04-30 09:28:33 +0200
committerZog2018-05-07 15:03:07 +0200
commitf0bbc8d002f845efe0bfecf37477e96c84a6b41c (patch)
tree955e0488bfe04ebe5a0665fbb0943d23d35efe07
parent7b336d1e47164a15c273f0899e8710e4fee273f8 (diff)
downloadchouette-core-f0bbc8d002f845efe0bfecf37477e96c84a6b41c.tar.bz2
Ignore failed Referentials when looking for duplicates
-rw-r--r--app/models/referential.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/referential.rb b/app/models/referential.rb
index 76b3bd84d..0c6e71d47 100644
--- a/app/models/referential.rb
+++ b/app/models/referential.rb
@@ -399,7 +399,7 @@ class Referential < ApplicationModel
query = "select distinct(public.referential_metadata.referential_id) FROM public.referential_metadata, unnest(line_ids) line, LATERAL unnest(periodes) period
WHERE public.referential_metadata.referential_id
- IN (SELECT public.referentials.id FROM public.referentials WHERE referentials.workbench_id = #{workbench_id} and referentials.archived_at is null and referentials.referential_suite_id is null #{not_myself})
+ IN (SELECT public.referentials.id FROM public.referentials WHERE referentials.workbench_id = #{workbench_id} and referentials.archived_at is null and referentials.referential_suite_id is null #{not_myself} AND referentials.failed_at IS NULL)
AND line in (#{line_ids.join(',')}) and (#{periods_query});"
self.class.connection.select_values(query).map(&:to_i)