mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-06 15:40:31 +08:00
23 lines
552 B
Ruby
23 lines
552 B
Ruby
# frozen_string_literal: true
|
|
|
|
module RepositoryColumns
|
|
class UpdateStatusColumnService < RepositoryColumns::ColumnService
|
|
def initialize(user:, team:, column:, params:)
|
|
super(user: user, repository: column.repository, team: team, column_name: nil)
|
|
@column = column
|
|
@params = params
|
|
end
|
|
|
|
def call
|
|
return self unless valid?
|
|
|
|
if @column.update(@params)
|
|
log_activity(:edit_column_inventory)
|
|
else
|
|
errors[:repository_column] = @column.errors.messages
|
|
end
|
|
|
|
self
|
|
end
|
|
end
|
|
end
|