Files
codeocean/app/models/community_solution.rb
Sebastian Serth da4e10b990 Add CommunitySolution
* Also slightly refactor some JS files
2021-11-23 01:38:31 +01:00

14 lines
435 B
Ruby

# frozen_string_literal: true
class CommunitySolution < ApplicationRecord
belongs_to :exercise
has_many :community_solution_locks
has_many :community_solution_contributions
has_and_belongs_to_many :users, polymorphic: true, through: :community_solution_contributions
has_many :files, class_name: 'CodeOcean::File', through: :community_solution_contributions
def to_s
"Gemeinschaftslösung für #{exercise}"
end
end