mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-01 04:32:16 +08:00
Move snapshot default selection to core from addon
This commit is contained in:
parent
e1e7496307
commit
d88040fd1b
1 changed files with 6 additions and 0 deletions
|
@ -10,10 +10,16 @@ module MyModuleStatusConsequences
|
|||
my_module.assigned_repositories.each do |repository|
|
||||
repository_snapshot = ::RepositorySnapshot.create_preliminary(repository, my_module)
|
||||
service = Repositories::SnapshotProvisioningService.call(repository_snapshot: repository_snapshot)
|
||||
|
||||
unless service.succeed?
|
||||
repository_snapshot.failed!
|
||||
raise StandardError, service.errors
|
||||
end
|
||||
|
||||
snapshot = service.repository_snapshot
|
||||
unless snapshot.my_module.repository_snapshots.where(parent_id: snapshot.parent_id).find_by(selected: true)
|
||||
snapshot.update!(selected: true)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue