diff --git a/app/helpers/locations_helper.rb b/app/helpers/locations_helper.rb index 2007e6ee4..411c0e632 100644 --- a/app/helpers/locations_helper.rb +++ b/app/helpers/locations_helper.rb @@ -73,7 +73,7 @@ module LocationsHelper attr[:value].blank? || (attr[:attribute] == "availability" && location.startdate.blank?) ? "Answer" : "Change" end - private +private ActivePeriod = Struct.new(:from, :to) def location_active_periods(location) diff --git a/app/models/location.rb b/app/models/location.rb index a4ad10801..6679eb27d 100644 --- a/app/models/location.rb +++ b/app/models/location.rb @@ -1,6 +1,6 @@ class Location < ApplicationRecord validates :postcode, on: :postcode, presence: { message: I18n.t("validations.location.postcode_blank") } - validate :validate_postcode, on: :postcode, if: Proc.new { |model| model.postcode.presence } + validate :validate_postcode, on: :postcode, if: proc { |model| model.postcode.presence } validates :location_admin_district, on: :location_admin_district, presence: { message: I18n.t("validations.location_admin_district") } validates :name, on: :name, presence: { message: I18n.t("validations.location.name") } validates :units, on: :units, presence: { message: I18n.t("validations.location.units") } diff --git a/app/views/locations/check_answers.html.erb b/app/views/locations/check_answers.html.erb index 666820b6f..d74fae2e4 100644 --- a/app/views/locations/check_answers.html.erb +++ b/app/views/locations/check_answers.html.erb @@ -22,7 +22,7 @@ <%= summary_list.row do |row| %> <% row.key { attr[:name] } %> <% row.value { details_html(attr) } %> - <% row.action(text: action_text_helper(attr, @location), href: location_edit_path(@location, attr[:attribute]))%> + <% row.action(text: action_text_helper(attr, @location), href: location_edit_path(@location, attr[:attribute])) %> <% end %> <% end %> <% end %>