-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
I noticed this could be refactored into a standard Rails association with a custom query:
https://github.com/mikeh-dev/KartCalendar/blob/72baf6065bf0fd4d02216f7a2bf721510db23fcf/app/models/user.rb#L25
Before:
def followed_championships
Championship.joins(:follows).where(follows: { user_id: id })
endAfter
has_many :followed_championships, ->(user) { joins(:follows).where(follows: {user_id: user.id}) }Metadata
Metadata
Assignees
Labels
No labels