mirror of
https://github.com/ryankazokas/turbovault-app.git
synced 2026-04-16 23:22:53 +00:00
Adds types
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user