add the claim mechanism

This commit is contained in:
starlee
2021-11-17 21:48:59 +08:00
parent d63626424e
commit e25e2fdd77
8 changed files with 201 additions and 0 deletions

21
app/models/claim.rb Normal file
View File

@@ -0,0 +1,21 @@
# == Schema Information
#
# Table name: claims
#
# id :integer not null, primary key
# issue_id :integer
# user_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# note :text(65535)
#
# Indexes
#
# index_claims_on_issue_id (issue_id)
# index_claims_on_user_id (user_id)
#
class Claim < ApplicationRecord
belongs_to :user, foreign_key: :user_id
scope :claim_includes, ->{includes(:user)}
end