Class: RecordLoader::RequestTypeValidatorsLoader
- Inherits:
-
ApplicationRecordLoader
- Object
- Base
- ApplicationRecordLoader
- RecordLoader::RequestTypeValidatorsLoader
- Defined in:
- lib/record_loader/request_type_validators_loader.rb
Overview
Creates the specified request type validators if they are not present
Instance Method Summary collapse
Methods inherited from ApplicationRecordLoader
Instance Method Details
#create_or_update!(key, options) ⇒ Object
12 13 14 15 16 |
# File 'lib/record_loader/request_type_validators_loader.rb', line 12 def create_or_update!(key, ) request_type_key = .delete('request_type_key') rt = RequestType.find_by(key: request_type_key) RequestType::Validator.create_with(.merge(request_type_id: rt.id)).find_or_create_by!(key:) end |