
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
14 lines
392 B
Ruby
14 lines
392 B
Ruby
class UserProxyExerciseExercise < ActiveRecord::Base
|
|
|
|
belongs_to :user, polymorphic: true
|
|
belongs_to :exercise
|
|
belongs_to :proxy_exercise
|
|
|
|
validates :user_id, presence: true
|
|
validates :user_type, presence: true
|
|
validates :exercise_id, presence: true
|
|
validates :proxy_exercise_id, presence: true
|
|
|
|
validates :user_id, uniqueness: { scope: [:proxy_exercise_id, :user_type] }
|
|
|
|
end |