Commit fea1022b authored by Matheus Horstmann's avatar Matheus Horstmann 🐴

Merge branch 'hotfix_create_city_hall' into 'master'

Fix Params on city_hall

See merge request !90
parents 142ebf36 1c53448f
Pipeline #19016 failed with stages
in 3 minutes and 18 seconds
......@@ -245,6 +245,7 @@ module Api::V1
params.require(:city_hall).permit(
:active,
:address_number,
:address_street,
:address_complement,
:block_text,
:citizen_access,
......
......@@ -147,9 +147,15 @@ class CityHall < ApplicationRecord
# self.active = true
if not address.nil?
self.city_id = address.city_id
self.address_street = address.address
self.neighborhood = address.neighborhood
if address.address.present?
self.address_street = address.address
end
if address.neighborhood.present?
self.neighborhood = address.neighborhood
end
if not address.number.nil?
self.address_number = address.number
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment