Class: RegistrationForm
Instance Attribute Summary
#raw_responce
Instance Method Summary
collapse
#persisted?
Instance Method Details
#session ⇒ Object
42
43
44
45
46
|
# File 'app/forms/registration_form.rb', line 42
def session
@session ||= TranslationCms::Api::Customer.authenticate!(email: email, password: password)
@session = nil unless @session.nil? || @session.errors.blank?
@session
end
|
#submit(is_translator = false) ⇒ Object
31
32
33
34
35
36
37
38
39
40
|
# File 'app/forms/registration_form.rb', line 31
def submit(is_translator = false)
api_answer = if is_translator
TranslationCms::Api::Translator.create(attributes)
else
TranslationCms::Api::Customer.create(attributes)
end
merge_responce! api_answer
errors.empty?
end
|