Sha256: 089a7c53c3c0d472847ca24b9cb0eba8a558c59c2dce4ae2f27cadd075bbbbd0
Contents?: true
Size: 811 Bytes
Versions: 19
Compression:
Stored size: 811 Bytes
Contents
# frozen_string_literal: true module Tramway::Core::ApplicationForms::SubmitHelper def submit(params) if params params.each { |key, value| send("#{key}=", value) } result = save result.tap do collecting_associations_errors unless result end else Tramway::Error.raise_error(:tramway, :core, :application_form, :submit, :params_should_not_be_nil) end end def save model.save rescue ArgumentError => e Tramway::Error.raise_error :tramway, :core, :application_form, :save, :argument_error, message: e.message rescue StandardError => e Tramway::Error.raise_error :tramway, :core, :application_form, :save, :looks_like_you_have_method, method_name: e.name.to_s.gsub('=', ''), model_class: @@model_class, class_name: self.class end end
Version data entries
19 entries across 19 versions & 1 rubygems