forgeplus/app/models/project_trend.rb

29 lines
687 B
Ruby
Raw Normal View History

2020-11-23 15:35:03 +08:00
# == Schema Information
#
# Table name: project_trends
#
# id :integer not null, primary key
# user_id :integer
# project_id :integer
# trend_type :string(255)
# trend_id :integer
# action_type :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_project_trends_on_trend_type_and_trend_id (trend_type,trend_id)
# index_project_trends_on_user_id_and_project_id (user_id,project_id)
#
2020-03-09 00:40:16 +08:00
class ProjectTrend < ApplicationRecord
2021-01-12 15:45:18 +08:00
CLOSE = 'close'
CREATE = 'create'
MERGE = 'merge'
2020-03-09 00:40:16 +08:00
belongs_to :project
belongs_to :trend, polymorphic: true, optional: true
belongs_to :user
end