|
|
@ -22,10 +22,10 @@ module Validations::LocalAuthorityValidations |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
if record.owning_organisation && record.owning_organisation.local_authorities.present? && |
|
|
|
if record.owning_organisation && record.owning_organisation.local_authorities.present? && |
|
|
|
record.la && !record.owning_organisation.local_authorities.include?(record.la) |
|
|
|
record.la && !record.owning_organisation.local_authorities.include?(record.la) |
|
|
|
la_name = record.form.get_question("la", record).label_from_value(record.la) |
|
|
|
la_name = record.form.get_question("la", record).label_from_value(record.la) |
|
|
|
org_name = record.owning_organisation.name |
|
|
|
org_name = record.owning_organisation.name |
|
|
|
record.errors.add :la, I18n.t("validations.property.la.la_invalid_for_org", org_name:, la_name:) |
|
|
|
record.errors.add :la, I18n.t("validations.property.la.la_invalid_for_org", org_name:, la_name:) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|