mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-10 22:06:46 +08:00
Give a candy to our special dog
This commit is contained in:
parent
042a33f2c7
commit
b25a7758db
2 changed files with 13 additions and 13 deletions
|
@ -310,13 +310,13 @@ class Experiment < ActiveRecord::Base
|
|||
def deep_clone_to_project(current_user, project)
|
||||
# First we have to find unique name for our little experiment
|
||||
experiment_names = project.experiments.map(&:name)
|
||||
format = "Clone %d - %s"
|
||||
format = 'Clone %d - %s'
|
||||
|
||||
i = 1
|
||||
i += 1 while experiment_names.include?((format % [i, name])[0, 50])
|
||||
i += 1 while experiment_names.include?((format(format, i, name))[0, 50])
|
||||
|
||||
clone = Experiment.new(
|
||||
name: (format % [i, name])[0, 50],
|
||||
name: (format(format, i, name))[0, 50],
|
||||
description: description,
|
||||
created_by: current_user,
|
||||
last_modified_by: current_user,
|
||||
|
|
|
@ -286,7 +286,7 @@ class MyModule < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def deep_clone(current_user)
|
||||
deep_clone_to_experiment(current_user, self.experiment)
|
||||
deep_clone_to_experiment(current_user, experiment)
|
||||
end
|
||||
|
||||
def deep_clone_to_experiment(current_user, experiment)
|
||||
|
|
Loading…
Add table
Reference in a new issue