Skip to content

Commit

Permalink
Merge pull request feedbin#405 from angristan/rake-task-make-admin
Browse files Browse the repository at this point in the history
Add rake task to promote users to admin
  • Loading branch information
benubois committed Mar 4, 2020
2 parents 39f0aed + 4926b10 commit c046b31
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/tasks/feedbin_make_admin.rake
@@ -0,0 +1,12 @@
namespace :feedbin do
desc "Promote user to admin status"
task :make_admin, :email do |task, args|
if args[:email]
User.find_by_email(args[:email]).update(admin: true)
puts "User with email #{args[:email]} is now an admin."
else
puts "Invalid command, use: rake feedbin:make_admin[email]"
exit 1
end
end
end

0 comments on commit c046b31

Please sign in to comment.