Add new GraphQL type for milestones

- added the milestone type to be displayed with investments
- the corresponding spec
This commit is contained in:
cyrillefr
2024-07-02 15:47:42 +02:00
committed by Javi Martín
parent 5ec6337d47
commit 18323a36c3
8 changed files with 38 additions and 0 deletions

View File

@@ -16,6 +16,9 @@ class Milestone < ApplicationRecord
scope :order_by_publication_date, -> { order(publication_date: :asc, created_at: :asc) }
scope :published, -> { where(publication_date: ..Date.current.end_of_day) }
scope :with_status, -> { where.not(status_id: nil) }
scope :public_for_api, -> do
where(milestoneable: [Proposal.public_for_api, Budget::Investment.public_for_api])
end
def self.title_max_length
80