blob: b634a2b83aab2e07b0f8300d585269df80019644 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# frozen_string_literal: true
module Services
module Addresses
# The service for address creation.
class CreateAddressService < AddressServicesBase
attr_reader :address
def call
if already_existing_address.nil?
@address = Address.new(@params)
@address.user_accounts << @user_account
@address.save
else
add_address_to_user_addresses
@address = already_existing_address
end
end
end
end
end
|