Class: AccountCpt::Registration::RegularUser::WithPassword
- Inherits:
-
Trailblazer::Operation
- Object
- Trailblazer::Operation
- AccountCpt::Registration::RegularUser::WithPassword
- Defined in:
- app/concepts/account_cpt/registration/regular_user/with_password.rb
Overview
return registered user
Instance Method Summary collapse
- #register_by_password!(options) ⇒ Object
- #reset_user_password!(options) ⇒ Object
-
#set_error_messages!(options) ⇒ Object
def collect_guest_booking!(options, *) user_id = options.id remove_customer_guest_booking(user_id) end.
Methods included from UserRegistration::MergeGuestBookings
#remove_customer_guest_booking
Methods included from ErrorOperationHelper
Instance Method Details
#register_by_password!(options) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/concepts/account_cpt/registration/regular_user/with_password.rb', line 19 def register_by_password!(, **) params = if ['contract.default.params'].respond_to?(:permit!) ['contract.default.params'].permit! else ['contract.default.params'] end service = ::UserRegistration::UsingPassword.new(params) if service.save [OpCons::OPERATION_RESULT] = service.user true else merge_errors { service.user.errors } false end end |
#reset_user_password!(options) ⇒ Object
44 45 46 |
# File 'app/concepts/account_cpt/registration/regular_user/with_password.rb', line 44 def reset_user_password!(, **) [OpCons::MODEL].password = nil end |
#set_error_messages!(options) ⇒ Object
def collect_guest_booking!(options, *)
user_id = [OpCons::OPERATION_RESULT].id
remove_customer_guest_booking(user_id)
end
40 41 42 |
# File 'app/concepts/account_cpt/registration/regular_user/with_password.rb', line 40 def (, **) merge_errors { [OpCons::CONTRACT_DEFAULT].errors } end |