14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/project_types/extension/tasks/converters/version_converter.rb', line 14
def self.from_hash(context, hash)
context.abort(context.message("tasks.errors.parse_error")) if hash.nil?
Models::Version.new(
registration_id: hash[REGISTRATION_ID_FIELD].to_i,
context: hash[CONTEXT_FIELD],
last_user_interaction_at: Time.parse(hash[LAST_USER_INTERACTION_AT_FIELD]),
location: hash[LOCATION_FIELD],
validation_errors: Converters::ValidationErrorConverter.from_array(context, hash[VALIDATION_ERRORS_FIELD])
)
end
|