Commit 3faa988e authored by James Lopez's avatar James Lopez

fix branch complexity

parent 54f00b74
......@@ -57,11 +57,7 @@ module Projects
after_create_actions if @project.persisted?
if @project.errors.empty?
@project.import_schedule if @project.import? && !@skip_import
else
fail(error: @project.errors.full_messages.join(', '))
end
import_schedule
@project
rescue ActiveRecord::RecordInvalid => e
......@@ -165,5 +161,15 @@ module Projects
@project.path = @project.name.dup.parameterize
end
end
private
def import_schedule
if @project.errors.empty?
@project.import_schedule if @project.import? && !@skip_import
else
fail(error: @project.errors.full_messages.join(', '))
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment