From f40288490517136966ab47d478c17494d4f99c7a Mon Sep 17 00:00:00 2001 From: Edward Anderson Date: Fri, 14 Apr 2017 21:49:52 -0400 Subject: [PATCH] Prevent Rikki bot from affecting behavior study --- db/migrate/201704142144_opt_out_the_bot.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 db/migrate/201704142144_opt_out_the_bot.rb diff --git a/db/migrate/201704142144_opt_out_the_bot.rb b/db/migrate/201704142144_opt_out_the_bot.rb new file mode 100644 index 0000000000..622cc8772d --- /dev/null +++ b/db/migrate/201704142144_opt_out_the_bot.rb @@ -0,0 +1,17 @@ +require 'exercism/user' + +class OptOutTheBot < ActiveRecord::Migration + class User < ActiveRecord::Base; end + + def up + User.where(username: 'rikki-').each do |rikki| + rikki.update_attribute :motivation_experiment_opt_out, true + end + end + + def down + User.where(username: 'rikki-').each do |rikki| + rikki.update_attribute :motivation_experiment_opt_out, false + end + end +end