mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 10:19:52 +01:00
added contributor rake task
This commit is contained in:
parent
af9c905165
commit
e671990a36
1 changed files with 20 additions and 0 deletions
20
Rakefile
20
Rakefile
|
@ -153,6 +153,26 @@ namespace :justask do
|
|||
puts "#{user.screen_name} is no longer an supporter."
|
||||
end
|
||||
|
||||
desc "Gives contributor status to an user."
|
||||
task :contrib, [:screen_name] => :environment do |t, args|
|
||||
fail "screen name required" if args[:screen_name].nil?
|
||||
user = User.find_by_screen_name(args[:screen_name])
|
||||
fail "user #{args[:screen_name]} not found" if user.nil?
|
||||
user.contributor = true
|
||||
user.save!
|
||||
puts "#{user.screen_name} is now a contributor."
|
||||
end
|
||||
|
||||
desc "Removes contributor status from an user."
|
||||
task :decontrib, [:screen_name] => :environment do |t, args|
|
||||
fail "screen name required" if args[:screen_name].nil?
|
||||
user = User.find_by_screen_name(args[:screen_name])
|
||||
fail "user #{args[:screen_name]} not found" if user.nil?
|
||||
user.contributor = false
|
||||
user.save!
|
||||
puts "#{user.screen_name} is no longer a contributor."
|
||||
end
|
||||
|
||||
desc "Lists all users."
|
||||
task lusers: :environment do
|
||||
User.all.each do |u|
|
||||
|
|
Loading…
Reference in a new issue