Add new GraphQL types for budget investments

- added 2 new types
- modified the models to get data through graphQL
- modified the corresponding spec
- also testing that hidden comments do not show up
- modified comments specs bc now it returns comments on budget
  investments
This commit is contained in:
cyrillefr
2024-06-06 13:11:56 +02:00
committed by Javi Martín
parent 5a45049273
commit 5ec6337d47
10 changed files with 133 additions and 6 deletions

View File

@@ -38,7 +38,10 @@ class Comment < ApplicationRecord
scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) }
scope :public_for_api, -> do
not_valuations
.where(commentable: [Debate.public_for_api, Proposal.public_for_api, Poll.public_for_api])
.where(commentable: [Debate.public_for_api,
Proposal.public_for_api,
Poll.public_for_api,
Budget::Investment.public_for_api])
end
scope :sort_by_most_voted, -> { order(confidence_score: :desc, created_at: :desc) }