17 lines
418 B
17 lines
418 B
5 years ago
|
class Admins::CompetitionBasicSettingService < ApplicationService
|
||
|
attr_reader :competition, :params
|
||
|
|
||
|
def initialize(competition, params)
|
||
|
@params = params
|
||
|
@competition = competition
|
||
|
end
|
||
|
|
||
|
def call
|
||
|
ActiveRecord::Base.transaction do
|
||
|
competition.name = strip params[:name]
|
||
|
competition.sub_title = strip params[:sub_title]
|
||
|
competition.start_time = params[:start_time]
|
||
|
|
||
|
end
|
||
|
end
|
||
|
end
|