]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/language.rb
Add inverse_of to relationships that can't detect it automatically
[rails.git] / app / models / language.rb
index cdf85a52bc3530cb11dc0eb3e0a05ed29d7f7a56..1158721e8de9cf062ff911bd6d6ee5028393d445 100644 (file)
@@ -10,7 +10,7 @@
 class Language < ApplicationRecord
   self.primary_key = "code"
 
-  has_many :diary_entries, :foreign_key => "language"
+  has_many :diary_entries, :foreign_key => "language", :inverse_of => :language
 
   def self.load(file)
     Language.transaction do