TokiTranslate/app/models/word.rb

8 lines
148 B
Ruby

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