aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/referential.rb
diff options
context:
space:
mode:
authorAlban Peignier2018-01-10 21:32:57 +0100
committerAlban Peignier2018-01-11 09:31:07 +0100
commit3aee5e1e5d7c54190453164b6954d685a86fcd3f (patch)
tree3743af635399cea44eaaf50cdd387a77263af044 /app/models/referential.rb
parent6f6488d1e589261d0bf6aef0020d1ac3478107d0 (diff)
downloadchouette-core-3aee5e1e5d7c54190453164b6954d685a86fcd3f.tar.bz2
Ignore referential_in_suite in Referential#overlapped_referential_ids (used by can_unarchive. Refs #5299
Diffstat (limited to 'app/models/referential.rb')
-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 3eb5d3283..2b7866d9f 100644
--- a/app/models/referential.rb
+++ b/app/models/referential.rb
@@ -323,7 +323,7 @@ class Referential < ActiveRecord::Base
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 #{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 line in (#{line_ids.join(',')}) and (#{periods_query});"
self.class.connection.select_values(query).map(&:to_i)