10 changed files with 78 additions and 3 deletions
			
			
		@ -0,0 +1,20 @@
					 | 
				
			||||
class OrganisationRelationshipsController < ApplicationController | 
				
			||||
  include Pagy::Backend | 
				
			||||
 | 
				
			||||
  before_action :authenticate_user! | 
				
			||||
 | 
				
			||||
  def managing_agents | 
				
			||||
    # kick out if org isn't the current org | 
				
			||||
 | 
				
			||||
    @managing_agents = OrganisationRelationships.where( | 
				
			||||
      owning_organisation_id: organisation.id, | 
				
			||||
      relationship_type: :managing, | 
				
			||||
    ) | 
				
			||||
  end | 
				
			||||
 | 
				
			||||
private | 
				
			||||
 | 
				
			||||
  def organisation | 
				
			||||
    @organisation ||= Organisation.find(params[:id]) | 
				
			||||
  end | 
				
			||||
end | 
				
			||||
@ -0,0 +1,3 @@
					 | 
				
			||||
<% @managing_agents.each do |managing_agent|%> | 
				
			||||
  <%= managing_agent.inspect %> | 
				
			||||
<% end %> | 
				
			||||
@ -0,0 +1,4 @@
					 | 
				
			||||
class RenameOrganisationsAgentsColumn < ActiveRecord::Migration[7.0] | 
				
			||||
  def change | 
				
			||||
  end | 
				
			||||
end | 
				
			||||
					Loading…
					
					
				
		Reference in new issue