Add position attribute to relation between exercise collection and exercises
This commit is contained in:
@@ -14,7 +14,8 @@ class Exercise < ActiveRecord::Base
|
||||
|
||||
has_and_belongs_to_many :proxy_exercises
|
||||
has_many :user_proxy_exercise_exercises
|
||||
has_and_belongs_to_many :exercise_collections
|
||||
has_many :exercise_collection_items
|
||||
has_many :exercise_collections, through: :exercise_collection_items
|
||||
has_many :user_exercise_interventions
|
||||
has_many :interventions, through: :user_exercise_interventions
|
||||
has_many :exercise_tags
|
||||
|
@@ -1,7 +1,8 @@
|
||||
class ExerciseCollection < ActiveRecord::Base
|
||||
include TimeHelper
|
||||
|
||||
has_and_belongs_to_many :exercises
|
||||
has_many :exercise_collection_items
|
||||
has_many :exercises, through: :exercise_collection_items
|
||||
belongs_to :user, polymorphic: true
|
||||
|
||||
def exercise_working_times
|
||||
|
4
app/models/exercise_collection_item.rb
Normal file
4
app/models/exercise_collection_item.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class ExerciseCollectionItem < ActiveRecord::Base
|
||||
belongs_to :exercise_collection
|
||||
belongs_to :exercise
|
||||
end
|
Reference in New Issue
Block a user