Rebuild rubocop TODOs after auto-correcting

This commit is contained in:
James Mason 2018-04-04 10:18:51 -07:00
parent 31c50255e9
commit 84dbb52d11
No known key found for this signature in database
GPG key ID: 1B3951886C449023
580 changed files with 3689 additions and 3133 deletions

View file

@ -1,21 +1,20 @@
namespace :user do
desc "Makes is_admin attribute true for user based on the supplied email address."
task :admin, [:email] => :environment do |t, args|
# frozen_string_literal: true
namespace :user do
desc 'Makes is_admin attribute true for user based on the supplied email address.'
task :admin, [:email] => :environment do |_t, args|
# Check if an email address was supplied
fail 'You need to define the email address of the user you want to make an admin.' unless args.email
raise 'You need to define the email address of the user you want to make an admin.' unless args.email
user = User.find_by(email: args.email)
# Check if a user is found based on the supplied email address
fail "There is no user with email #{args.email}!" unless user
raise "There is no user with email #{args.email}!" unless user
if user.update_columns(is_admin: true)
puts "User with email #{args.email} is now an admin!"
end
puts "User with email #{args.email} is now an admin!" if user.update_columns(is_admin: true)
end
desc "Set email_public attrubute true for all users"
task :set_email_public => :environment do
desc 'Set email_public attrubute true for all users'
task set_email_public: :environment do
User.update_all email_public: true
end
end