Skip to content

Commit

Permalink
RBS: Add types for Announcement::ActiveRecord_Relation#published
Browse files Browse the repository at this point in the history
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: pocke/rbs_rails#268
  • Loading branch information
tk0miya committed Nov 6, 2023
1 parent 51ffcaf commit e7f66df
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sig/handwritten/app/models/announcement.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e7f66df

Please sign in to comment.