Adds types

This commit is contained in:
2026-03-29 02:37:49 -04:00
parent 63276ef8ca
commit 323484a33a
44 changed files with 1273 additions and 121 deletions

View File

@@ -1,4 +1,7 @@
# typed: true
class Game < ApplicationRecord
extend T::Sig
# Associations
belongs_to :user
belongs_to :platform
@@ -54,12 +57,14 @@ class Game < ApplicationRecord
scope :needs_igdb_review, -> { joins(:igdb_match_suggestions).where(igdb_match_suggestions: { status: "pending" }).distinct }
# Class methods
sig { params(query: String).returns(T.untyped) }
def self.search(query)
where("title ILIKE ?", "%#{sanitize_sql_like(query)}%")
end
private
sig { void }
def set_date_added
self.date_added ||= Date.current
end