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
|
Reference in New Issue
Block a user