Skip to content

Commit

Permalink
Add activestorage.rbi.
Browse files Browse the repository at this point in the history
Various methods were not being handled correctly (e.g. `variant?`) for
Rails models that were using ActiveStorage. This fixes many of those
issues.
  • Loading branch information
connorshea committed Sep 18, 2022
1 parent 5fd791d commit 7452621
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions rbi/annotations/activestorage.rbi
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# typed: strict

class ActiveStorage::Attached::One
# @shim: Methods on Attached::One are delegated to `ActiveStorage::Blob` through `ActiveStorage::Attachment` using `method_missing`
include ActiveStorage::Blob::Analyzable
include ActiveStorage::Blob::Identifiable
include ActiveStorage::Blob::Representable
end

class ActiveStorage::Attached::Many
# @shim: Methods on Attached::Many are delegated to `ActiveStorage::Blob` through `ActiveStorage::Attachment` using `method_missing`
include ActiveStorage::Blob::Analyzable
include ActiveStorage::Blob::Identifiable
include ActiveStorage::Blob::Representable
end

0 comments on commit 7452621

Please sign in to comment.