diff --git a/app/views/canvas/edit/modal/_move_module.html.erb b/app/views/canvas/edit/modal/_move_module.html.erb
index f77f7c27b..7aa592df9 100644
--- a/app/views/canvas/edit/modal/_move_module.html.erb
+++ b/app/views/canvas/edit/modal/_move_module.html.erb
@@ -6,9 +6,10 @@
<%=t "experiments.canvas.edit.modal_move_module.title" %>
- <% if @experiment.project.experiments.is_archived(false).count > 1 %>
+ <% experiments = @experiment.project.experiments.is_archived(false) %>
+ <% if experiments.count > 1 %>
<%= bootstrap_form_tag do |f| %>
- <%= f.select :experiment_id, @experiment.project.experiments.is_archived(false)
+ <%= f.select :experiment_id, experiments
.select { |e| e != @experiment }
.collect { |e| [ e.name, e.id ] }, {},
{class: "form-control selectpicker", "data-role" => "clear"} %>
@@ -23,7 +24,9 @@
diff --git a/app/views/canvas/edit/modal/_move_module_group.html.erb b/app/views/canvas/edit/modal/_move_module_group.html.erb
index a9f109178..6be739206 100644
--- a/app/views/canvas/edit/modal/_move_module_group.html.erb
+++ b/app/views/canvas/edit/modal/_move_module_group.html.erb
@@ -6,9 +6,10 @@
<%=t "experiments.canvas.edit.modal_move_module_group.title" %>
- <% if @experiment.project.experiments.is_archived(false).count > 1 %>
+ <% experiments = @experiment.project.experiments.is_archived(false) %>
+ <% if experiments.count > 1 %>
<%= bootstrap_form_tag do |f| %>
- <%= f.select :experiment_id, @experiment.project.experiments.is_archived(false)
+ <%= f.select :experiment_id, experiments
.select { |e| e != @experiment }
.collect { |e| [ e.name, e.id ] }, {},
{class: "form-control selectpicker", "data-role" => "clear"} %>
@@ -23,7 +24,9 @@