class Word < ApplicationRecord has_many :definitions def definitions_for(language) self.definitions.where(language_id: language) end end