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 IgdbGame < ApplicationRecord
|
||||
extend T::Sig
|
||||
# Associations
|
||||
has_many :igdb_match_suggestions
|
||||
has_many :games, foreign_key: :igdb_id, primary_key: :igdb_id
|
||||
@@ -12,10 +15,12 @@ class IgdbGame < ApplicationRecord
|
||||
scope :recent, -> { order(last_synced_at: :desc) }
|
||||
|
||||
# Instance methods
|
||||
sig { void }
|
||||
def increment_match_count!
|
||||
increment!(:match_count)
|
||||
end
|
||||
|
||||
sig { params(size: String).returns(T.nilable(String)) }
|
||||
def cover_image_url(size = "cover_big")
|
||||
return nil unless cover_url.present?
|
||||
# IGDB uses image IDs like "co1234"
|
||||
|
||||
Reference in New Issue
Block a user