Add subscription model and link it to RFC
This commit is contained in:
@@ -5,6 +5,8 @@ class RequestForComment < ActiveRecord::Base
|
||||
belongs_to :file, class_name: 'CodeOcean::File'
|
||||
|
||||
has_many :comments, through: :submission
|
||||
has_many :subscriptions
|
||||
has_many :subscribers, through: :subscriptions, source: :user, source_type: ExternalUser
|
||||
|
||||
scope :unsolved, -> { where(solved: [false, nil]) }
|
||||
|
||||
|
4
app/models/subscription.rb
Normal file
4
app/models/subscription.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class Subscription < ActiveRecord::Base
|
||||
belongs_to :user, polymorphic: true
|
||||
belongs_to :request_for_comment
|
||||
end
|
Reference in New Issue
Block a user