Merge pull request '易修声明功能' (#284) from starlee/forgeplus:lzx-claim-2.0 into standalone_develop

This commit is contained in:
2021-12-08 15:12:15 +08:00
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

View File

@@ -64,6 +64,7 @@ class Issue < ApplicationRecord
# has_many :memos
has_many :journals, :as => :journalized, :dependent => :destroy
has_many :journal_details, through: :journals
has_many :claims, :dependent => :destroy
has_many :issue_tags_relates, dependent: :destroy
has_many :issue_tags, through: :issue_tags_relates
has_many :issue_times, dependent: :destroy