Skip to content

Commit

Permalink
include and fix observation unit #2124
Browse files Browse the repository at this point in the history
  • Loading branch information
stuzart committed Jan 30, 2025
1 parent 2ec4fec commit 685ec25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
8 changes: 0 additions & 8 deletions app/models/observation_unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ def contributors
[contributor]
end

def is_in_isa_publishable?
false
end

def can_publish?
false
end

def related_people
(creators + contributors).compact.uniq
end
Expand Down
9 changes: 7 additions & 2 deletions test/unit/permissions/publishing_permissions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class PublishingPermissionsTest < ActiveSupport::TestCase
refute item.gatekeeper_required?

case item.class.name
when 'Study', 'Assay'
when 'Study', 'Assay', 'ObservationUnit'
disable_authorization_checks { item.investigation.projects = gatekeeper.projects }
else
disable_authorization_checks { item.projects = gatekeeper.projects }
Expand Down Expand Up @@ -371,12 +371,17 @@ def items_for_publishing_tests(contributor = FactoryBot.create(:person))
FactoryBot.create(type, contributor: contributor, projects: contributor&.projects)
end

#projects handled differently
study = FactoryBot.create(:study, contributor: contributor,
investigation: FactoryBot.create(:investigation, projects: contributor&.projects)
)
assay = FactoryBot.create(:assay, contributor: contributor, study:
FactoryBot.create(:study, contributor: contributor, investigation: FactoryBot.create(:investigation, projects: contributor&.projects))
)
items | [study, assay]
obs_unit = FactoryBot.create(:observation_unit, contributor: contributor, policy: FactoryBot.create(:private_policy), study:
FactoryBot.create(:study, contributor: contributor, investigation: FactoryBot.create(:investigation, projects: contributor&.projects))
)
items | [study, assay, obs_unit]
[obs_unit]
end
end

0 comments on commit 685ec25

Please sign in to comment.