diff --git a/app/models/repository.rb b/app/models/repository.rb index b0f40d30b..8f9c3f271 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -51,7 +51,7 @@ class Repository < RepositoryBase } scope :appendable_by_user, lambda { |user, teams = user.current_team| - readable_ids = active.with_granted_permissions(user, RepositoryPermissions::ROWS_CREATE).where(team: teams).pluck(:id) + readable_ids = with_granted_permissions(user, RepositoryPermissions::ROWS_CREATE).where(team: teams).pluck(:id) shared_with_team_ids = joins(:team_shared_objects, :team).where(team_shared_objects: { team: teams, permission_level: :shared_write }).pluck(:id) globally_shared_ids = if column_names.include?('permission_level') @@ -66,7 +66,7 @@ class Repository < RepositoryBase none.pluck(:id) end - where(id: (readable_ids + shared_with_team_ids + globally_shared_ids).uniq) + active.where(id: (readable_ids + shared_with_team_ids + globally_shared_ids).uniq) } def self.within_global_limits?