Fix creating exercise collections with exercises

This commit is contained in:
Maximilian Grundke
2018-08-22 13:41:23 +02:00
parent 16933632ae
commit 11dc48dc96
3 changed files with 6 additions and 4 deletions

View File

@ -3,7 +3,7 @@ class ExerciseCollection < ActiveRecord::Base
has_many :exercise_collection_items
alias_method :items, :exercise_collection_items
has_many :exercises, through: :exercise_collection_items
has_many :exercises, through: :exercise_collection_items, inverse_of: :exercise_collections
belongs_to :user, polymorphic: true
def collection_statistics