Check polymorphic type in validations
* Previously, some models had "duplicated" `belongs_to` associations, which were now removed (and replaced by the `include Creation`).
This commit is contained in:

committed by
Sebastian Serth

parent
be4f2b790d
commit
977fa4539e
@@ -1,12 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ExerciseCollection < ApplicationRecord
|
||||
include Creation
|
||||
include TimeHelper
|
||||
|
||||
has_many :exercise_collection_items, dependent: :delete_all
|
||||
alias items exercise_collection_items
|
||||
has_many :exercises, through: :exercise_collection_items, inverse_of: :exercise_collections
|
||||
belongs_to :user, polymorphic: true
|
||||
|
||||
def collection_statistics
|
||||
statistics = {}
|
||||
|
Reference in New Issue
Block a user