From e7f66df8774f9ce9ce2f31945e28cbb8417f614b Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Wed, 1 Nov 2023 15:51:39 +0000 Subject: [PATCH] RBS: Add types for Announcement::ActiveRecord_Relation#published As a preparation of giving types to controllers, this adds types for `Announcement::ActiveRecord_Relation#published` manually because current rbs_rails does not support Rails7 style enums. It should be removed if rbs_rails will support it in the future. refs: https://github.com/pocke/rbs_rails/pull/268 --- sig/handwritten/app/models/announcement.rbs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sig/handwritten/app/models/announcement.rbs b/sig/handwritten/app/models/announcement.rbs index 04ae855a..cc7035e0 100644 --- a/sig/handwritten/app/models/announcement.rbs +++ b/sig/handwritten/app/models/announcement.rbs @@ -3,4 +3,11 @@ class Announcement < ApplicationRecord # It should be removed if rbs_rails will support it. # refs: https://github.com/pocke/rbs_rails/pull/268 def self.published: () -> Announcement::ActiveRecord_Relation + + class ActiveRecord_Relation + # NOTE: This method has been declared manually because current rbs_rails does not support enum definitions. + # It should be removed if rbs_rails will support it. + # refs: https://github.com/pocke/rbs_rails/pull/268 + def published: () -> self + end end