Skip to content

Instantly share code, notes, and snippets.

@Hasstrup
Created November 5, 2024 22:35
Show Gist options
  • Save Hasstrup/7534551cad67f34e57ef8646eb75cb5c to your computer and use it in GitHub Desktop.
Save Hasstrup/7534551cad67f34e57ef8646eb75cb5c to your computer and use it in GitHub Desktop.
# frozen_string_literal: true
class Templates::Components::Contexts::Creation < BaseService
performs_checks
def initialize(input:)
@input = input
end
def call
safely_execute do
succeed(::Templates::Component.create!(**input.to_h.except(:user_id)))
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment