Skip to content

Commit

Permalink
active_hash: Fix ActiveHash::Base.find does not return nil (ruby#455)
Browse files Browse the repository at this point in the history
It raises an exception if the target entry not found.  Therefore it
would be better to use non-optional types for its retval.
  • Loading branch information
tk0miya authored and sw-square committed Jan 22, 2024
1 parent fd21f9e commit 61b5e20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gems/active_hash/3.2/active_hash.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module ActiveHash
def self.find: (:all) -> Relation[instance]
| (:first, *untyped args) -> instance?
| (Array[untyped] id) -> Array[instance]
| (untyped id) -> instance?
| (untyped id) -> instance
| () { (instance) -> boolish } -> instance?
def self.find_by: (untyped options) -> instance?
def self.find_by!: (untyped options) -> instance
Expand Down

0 comments on commit 61b5e20

Please sign in to comment.