aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjpl2016-11-21 10:56:39 +0100
committerjpl2016-11-21 10:56:39 +0100
commitc64a5dddc00a6431c17c75ce278ca0d1f1199b96 (patch)
tree95779513496ebb3083afdfd4c2a9c6eb709ce79d
parent42211f9ada95be2bc73c0db8e5591f2ca3548f6a (diff)
downloadchouette-core-c64a5dddc00a6431c17c75ce278ca0d1f1199b96.tar.bz2
Fixes workbench_id in overlapped_referential_ids request. Refs #1864
-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 b99b42286..300ff3239 100644
--- a/app/models/referential.rb
+++ b/app/models/referential.rb
@@ -230,7 +230,7 @@ class Referential < ActiveRecord::Base
(SELECT unnest(public.referential_metadata.line_ids) as line, unnest(public.referential_metadata.periodes) as period, public.referential_metadata.referential_id
FROM public.referential_metadata
INNER JOIN public.referentials ON public.referential_metadata.referential_id = public.referentials.id
- WHERE public.referentials.workbench_id = 1 and public.referentials.archived_at is null) as metadatas
+ WHERE public.referentials.workbench_id = #{workbench_id} and public.referentials.archived_at is null) as metadatas
WHERE line in (#{line_ids.join(',')}) and period && '#{ActiveRecord::ConnectionAdapters::PostgreSQLColumn.range_to_string(period)}' #{not_myself};"
self.class.connection.select_values(query).map(&:to_i)