Add user (ID and type) to proxy exercise
This is required for the existing policies to work
This commit is contained in:
9
db/migrate/20181119161514_add_user_to_proxy_exercise.rb
Normal file
9
db/migrate/20181119161514_add_user_to_proxy_exercise.rb
Normal file
@ -0,0 +1,9 @@
|
||||
class AddUserToProxyExercise < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_reference :proxy_exercises, :user, polymorphic: true, index: true
|
||||
add_column :proxy_exercises, :public, :boolean, null: false, default: false
|
||||
|
||||
internal_user = InternalUser.find_by(id: 46)
|
||||
ProxyExercise.update_all(user_id: internal_user.id, user_type: internal_user.class.name)
|
||||
end
|
||||
end
|
@ -263,6 +263,10 @@ ActiveRecord::Schema.define(version: 2018_11_29_093207) do
|
||||
t.string "token"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "user_type"
|
||||
t.bigint "user_id"
|
||||
t.boolean "public"
|
||||
t.index ["user_type", "user_id"], name: "index_proxy_exercises_on_user_type_and_user_id"
|
||||
end
|
||||
|
||||
create_table "remote_evaluation_mappings", force: :cascade do |t|
|
||||
|
Reference in New Issue
Block a user