
Tags can be added to exercises in the edit view. Tags can monitored under /tags. Added the concept of ProxyExercises which are a collection of Exercises. They can be found under /proxy_exercises Added Interventions as prework to show interventions later to the user. Added exercise/[:id]/working_time to return the working time of the user in this exercise and the average working time of all users in this exercise
24 lines
626 B
Ruby
24 lines
626 B
Ruby
class CreateProxyExercises < ActiveRecord::Migration
|
|
def change
|
|
create_table :proxy_exercises do |t|
|
|
t.string :title
|
|
t.string :description
|
|
t.string :token
|
|
t.timestamps
|
|
end
|
|
|
|
create_table :exercises_proxy_exercises, id: false do |t|
|
|
t.belongs_to :proxy_exercise, index: true
|
|
t.belongs_to :exercise, index: true
|
|
t.timestamps
|
|
end
|
|
|
|
create_table :user_proxy_exercise_exercises do |t|
|
|
t.belongs_to :user, polymorphic: true, index: true
|
|
t.belongs_to :proxy_exercise, index: true
|
|
t.belongs_to :exercise, index: true
|
|
t.timestamps
|
|
end
|
|
end
|
|
end
|