# frozen_string_literal: true # == Schema Information # # Table name: mod_notes # # id :integer not null, primary key # body :text not null # deleted :boolean default(FALSE), not null # notable_type :string not null # created_at :datetime not null # updated_at :datetime not null # moderator_id :integer not null # notable_id :integer not null # # Indexes # # index_mod_notes_on_moderator_id (moderator_id) # index_mod_notes_on_notable_type_and_notable_id (notable_type,notable_id) # # Foreign Keys # # fk_rails_... (moderator_id => users.id) ON DELETE => restrict ON UPDATE => cascade # class ModNote < ApplicationRecord belongs_to :moderator, class_name: 'User', optional: true belongs_to :notable, polymorphic: true, optional: true resourcify end