]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/note_comment.rb
Enable active_record.belongs_to_required_by_default
[rails.git] / app / models / note_comment.rb
index 9611cfe3af375861b865ec17582b0d278fae6c1f..999d045075f2f033bfc2a4e0ab9e8d83b296000a 100644 (file)
@@ -24,8 +24,8 @@
 #
 
 class NoteComment < ApplicationRecord
-  belongs_to :note, :foreign_key => :note_id, :touch => true
-  belongs_to :author, :class_name => "User", :foreign_key => :author_id
+  belongs_to :note, :touch => true
+  belongs_to :author, :class_name => "User", :optional => true
 
   validates :id, :uniqueness => true, :presence => { :on => :update },
                  :numericality => { :on => :update, :only_integer => true }