|
|
@ -51,6 +51,11 @@ class OrganisationRelationshipsController < ApplicationController |
|
|
|
@organisations = Organisation.where.not(id: child_organisation.id).pluck(:id, :name) |
|
|
|
@organisations = Organisation.where.not(id: child_organisation.id).pluck(:id, :name) |
|
|
|
render "organisation_relationships/add_housing_provider" |
|
|
|
render "organisation_relationships/add_housing_provider" |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
elsif !parent_organisation.holds_own_stock |
|
|
|
|
|
|
|
@organisation.errors.add :related_organisation_id, I18n.t("validations.scheme.owning_organisation.does_not_own_stock") |
|
|
|
|
|
|
|
@organisations = Organisation.where.not(id: child_organisation.id).pluck(:id, :name) |
|
|
|
|
|
|
|
render "organisation_relationships/add_housing_provider" |
|
|
|
|
|
|
|
return |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
create!(child_organisation:, parent_organisation:) |
|
|
|
create!(child_organisation:, parent_organisation:) |
|
|
|