diff --git a/app/controllers/admin/geozones_controller.rb b/app/controllers/admin/geozones_controller.rb index 6b755e5f3..a8648f287 100644 --- a/app/controllers/admin/geozones_controller.rb +++ b/app/controllers/admin/geozones_controller.rb @@ -33,15 +33,10 @@ class Admin::GeozonesController < Admin::BaseController end def destroy - # Check that in none of the other associated models talbes a record exists + # Check that in none of the other associated models tables a record exists # referencing this geozone safe_to_destroy = true - # safe_to_destroy &= Proposal.where(geozone: @geozone).empty? - # safe_to_destroy &= Debate.where(geozone: @geozone).empty? - # safe_to_destroy &= SpendingProposal.where(geozone: @geozone).empty? - # safe_to_destroy &= User.where(geozone: @geozone).empty? - Geozone.reflect_on_all_associations.each do |association| attached_model = association.klass safe_to_destroy &= attached_model.where(geozone: @geozone).empty? @@ -58,6 +53,6 @@ class Admin::GeozonesController < Admin::BaseController private def geozone_params - params.require(:geozone).permit(:name, :external_code, :census_code) + params.require(:geozone).permit(:name, :external_code, :census_code, :html_map_coordinates) end end diff --git a/app/views/admin/geozones/_form.html.erb b/app/views/admin/geozones/_form.html.erb index 323a6fbb1..e92b98c0b 100644 --- a/app/views/admin/geozones/_form.html.erb +++ b/app/views/admin/geozones/_form.html.erb @@ -3,15 +3,19 @@ <%= render 'errors' %>