price-point-api/app/models/price_report.rb
2026-05-30 17:54:26 +03:00

34 lines
961 B
Ruby

# == Schema Information
#
# Table name: price_reports
#
# id :bigint not null, primary key
# discount_price :decimal(, )
# downvotes :integer
# price :decimal(, )
# reported_at :datetime
# upvotes :integer
# created_at :datetime not null
# updated_at :datetime not null
# product_id :integer not null
# store_id :integer not null
# user_id :bigint not null
#
# Indexes
#
# index_price_reports_on_product_id (product_id)
# index_price_reports_on_store_id (store_id)
# index_price_reports_on_user_id (user_id)
#
# Foreign Keys
#
# fk_rails_... (product_id => products.id)
# fk_rails_... (store_id => stores.id)
# fk_rails_... (user_id => users.id)
#
class PriceReport < ApplicationRecord
belongs_to :product
belongs_to :store
belongs_to :user
has_many :moderation_logs, as: :moderatable, dependent: :destroy
end