]> 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 448703ffa5f8d38471a7ecc2767f4ca41771af7b..999d045075f2f033bfc2a4e0ab9e8d83b296000a 100644 (file)
@@ -23,9 +23,9 @@
 #  note_comments_note_id_fkey    (note_id => notes.id)
 #
 
-class NoteComment < ActiveRecord::Base
-  belongs_to :note, :foreign_key => :note_id, :touch => true
-  belongs_to :author, :class_name => "User", :foreign_key => :author_id
+class NoteComment < ApplicationRecord
+  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 }