mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-06 21:24:23 +08:00
Fixes bugs on canvas [fixes SCI-1408]
This commit is contained in:
parent
b830be3ec6
commit
bef5a085c4
2 changed files with 7 additions and 7 deletions
|
@ -762,7 +762,7 @@ class Experiment < ApplicationRecord
|
||||||
dg.to_undirected.each_connected_component { |w| workflows << w }
|
dg.to_undirected.each_connected_component { |w| workflows << w }
|
||||||
|
|
||||||
# Retrieve maximum allowed module group name
|
# Retrieve maximum allowed module group name
|
||||||
max_length = (MyModuleGroup.validators_on(:name).select { |v| v.class == ActiveModel::Validations::LengthValidator }).first.options[:maximum]
|
max_length = Constants::NAME_MAX_LENGTH
|
||||||
# For each workflow, generate new names
|
# For each workflow, generate new names
|
||||||
new_index = 1
|
new_index = 1
|
||||||
wf_names = []
|
wf_names = []
|
||||||
|
@ -797,7 +797,7 @@ class Experiment < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
# Remove any existing module groups from modules
|
# Remove any existing module groups from modules
|
||||||
unless MyModuleGroup.destroy_all(:id => group_ids.to_a)
|
unless MyModuleGroup.where(id: group_ids.to_a).destroy_all
|
||||||
raise ActiveRecord::ActiveRecordError
|
raise ActiveRecord::ActiveRecordError
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -135,10 +135,10 @@ class MyModule < ApplicationRecord
|
||||||
MyModule.transaction do
|
MyModule.transaction do
|
||||||
archived = super
|
archived = super
|
||||||
# Unassociate all samples from module.
|
# Unassociate all samples from module.
|
||||||
archived = SampleMyModule.destroy_all(:my_module => self) if archived
|
archived = SampleMyModule.where(my_module: self).destroy_all if archived
|
||||||
# Remove all connection between modules.
|
# Remove all connection between modules.
|
||||||
archived = Connection.delete_all(:input_id => id) if archived
|
archived = Connection.where(input_id: id).delete_all if archived
|
||||||
archived = Connection.delete_all(:output_id => id) if archived
|
archived = Connection.where(output_id: id).delete_all if archived
|
||||||
unless archived
|
unless archived
|
||||||
raise ActiveRecord::Rollback
|
raise ActiveRecord::Rollback
|
||||||
end
|
end
|
||||||
|
@ -285,7 +285,7 @@ class MyModule < ApplicationRecord
|
||||||
if !final.include?(my_module)
|
if !final.include?(my_module)
|
||||||
final << my_module
|
final << my_module
|
||||||
end
|
end
|
||||||
modules.push(*my_module.my_modules.flatten)
|
modules.push(*my_module.my_modules)
|
||||||
end
|
end
|
||||||
final
|
final
|
||||||
end
|
end
|
||||||
|
@ -299,7 +299,7 @@ class MyModule < ApplicationRecord
|
||||||
if !final.include?(my_module)
|
if !final.include?(my_module)
|
||||||
final << my_module
|
final << my_module
|
||||||
end
|
end
|
||||||
modules.push(*my_module.my_module_antecessors.flatten)
|
modules.push(*my_module.my_module_antecessors)
|
||||||
end
|
end
|
||||||
final
|
final
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue