summaryrefslogtreecommitdiff
path: root/app/controllers/services
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-03-24 20:52:53 -0600
committerHombreLaser <sebastian-440@live.com>2023-03-24 20:52:53 -0600
commit1e0f07669f6bb1b6f93fb98fc0b3b7d3e2d62520 (patch)
treed97398181a7f9cfb837e5c1ecf431246a63bbfc2 /app/controllers/services
parentdb54484188304747af8e6c8299f1ccb5b3e1095f (diff)
Fixes a los servicios de Address
Diffstat (limited to 'app/controllers/services')
-rw-r--r--app/controllers/services/address_services_base.rb2
-rw-r--r--app/controllers/services/create_address_service.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/services/address_services_base.rb b/app/controllers/services/address_services_base.rb
index 622873e..176b901 100644
--- a/app/controllers/services/address_services_base.rb
+++ b/app/controllers/services/address_services_base.rb
@@ -11,7 +11,7 @@ module Services
private
def already_existing_address
- @already_existing_address ||= Address.find_by(params)
+ @already_existing_address ||= Address.find_by(@params)
end
def add_address_to_user_addresses
diff --git a/app/controllers/services/create_address_service.rb b/app/controllers/services/create_address_service.rb
index 5ded4f7..431ccd1 100644
--- a/app/controllers/services/create_address_service.rb
+++ b/app/controllers/services/create_address_service.rb
@@ -7,7 +7,9 @@ module Services
def call
if already_existing_address.nil?
- @address = @user_account.addresses.create(@params)
+ @address = Address.new(@params)
+ @address.user_accounts << @user_account
+ @address.save
else
add_address_to_user_addresses
@address = already_existing_address