Task create and update
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ApplicationService
|
||||
include ActiveModel::Model
|
||||
include ActiveModel::Attributes
|
||||
|
||||
attr_reader :errors
|
||||
|
||||
def perform
|
||||
# Override this
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def save(model)
|
||||
model.save.tap { @errors = model.errors }
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user