Created
November 5, 2024 21:27
-
-
Save Hasstrup/243ea5484621243f9cb51005be2508dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
class Templates::Templates::CreateInput < BaseInput | |
REQUIRED_KEYS = %i[title file_name file_base64 user_id] | |
attributes(*REQUIRED_KEYS) | |
def validate! | |
validate_required_keys! | |
validate_user! | |
end | |
private | |
def validate_user! | |
within_error_context do | |
validate_association!(user_id, User) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment