rails g migration AddUserToTasks user:references
add user_id in tasks
add not null for user_id