Browse Source
* feat: add absorbing_organisation relationship to orgs * feat: wip absorbed orgs visibility work * feat: add absorbed orgs to filter options, make unique * refactor: simplify * feat: add test * feat: update schema * feat: add absorbed org to user relations * feat: be more explicit about org scopes * feat: update log org question selections * feat: add org question to sales for all users (to be specified again in later ticket) * feat: revert previous and handle in separate ticket * feat: update validation and tests * feat: reload org to populate associations * feat: check for holding own stock in stock owner question, add schema * feat: add/update org filter tests * feat: update test * feat: update created by id pagespull/1808/head
natdeanlewissoftwire
1 year ago
committed by
GitHub
21 changed files with 148 additions and 48 deletions
@ -1,4 +1,4 @@ |
|||||||
class Form::Common::Questions::OwningOrganisationId < ::Form::Question |
class Form::Sales::Questions::OwningOrganisationId < ::Form::Question |
||||||
def initialize(id, hsh, page) |
def initialize(id, hsh, page) |
||||||
super |
super |
||||||
@id = "owning_organisation_id" |
@id = "owning_organisation_id" |
@ -0,0 +1,5 @@ |
|||||||
|
class AddAbsorbingOrganisationIdToOrganisations < ActiveRecord::Migration[7.0] |
||||||
|
def change |
||||||
|
add_reference :organisations, :absorbing_organisation, null: true, foreign_key: { to_table: :organisations } |
||||||
|
end |
||||||
|
end |
@ -1,6 +1,6 @@ |
|||||||
require "rails_helper" |
require "rails_helper" |
||||||
|
|
||||||
RSpec.describe Form::Common::Pages::Organisation, type: :model do |
RSpec.describe Form::Sales::Pages::Organisation, type: :model do |
||||||
subject(:page) { described_class.new(page_id, page_definition, subsection) } |
subject(:page) { described_class.new(page_id, page_definition, subsection) } |
||||||
|
|
||||||
let(:page_id) { nil } |
let(:page_id) { nil } |
@ -1,6 +1,6 @@ |
|||||||
require "rails_helper" |
require "rails_helper" |
||||||
|
|
||||||
RSpec.describe Form::Common::Questions::OwningOrganisationId, type: :model do |
RSpec.describe Form::Sales::Questions::OwningOrganisationId, type: :model do |
||||||
subject(:question) { described_class.new(question_id, question_definition, page) } |
subject(:question) { described_class.new(question_id, question_definition, page) } |
||||||
|
|
||||||
let(:question_id) { nil } |
let(:question_id) { nil } |
Loading…
Reference in new issue