Class: MetadataPresenter::UploadValidator
Instance Attribute Summary
#component, #page_answers
Instance Method Summary
collapse
#allow_blank?, #custom_error_message, #default_error_message, #initialize, #schema_key, #valid?, #validation_value
Instance Method Details
#error_message_hash ⇒ Object
13
14
15
16
17
18
|
# File 'app/validators/metadata_presenter/upload_validator.rb', line 13
def error_message_hash
{
control: page_answers.send(component.id)['original_filename'],
schema_key.to_sym => component.validation[schema_key]
}
end
|
#invalid_answer? ⇒ Boolean
3
4
5
|
# File 'app/validators/metadata_presenter/upload_validator.rb', line 3
def invalid_answer?
user_answer.error_name == error_name
end
|
#user_answer ⇒ Object
7
8
9
10
11
|
# File 'app/validators/metadata_presenter/upload_validator.rb', line 7
def user_answer
page_answers.uploaded_files.find do |uploaded_file|
component.id == uploaded_file.component.id
end
end
|