Add sync certain user_names feature in rake.
This commit is contained in:
parent
6ecb0a204e
commit
fc3832da35
|
@ -362,8 +362,12 @@ module AsiaSyncPlugin
|
|||
end
|
||||
namespace :sync_asia_personal_plugins do
|
||||
desc 'sync_personal_plugins from Asia'
|
||||
task :sync => [:environment] do
|
||||
users = User.all.to_a
|
||||
task :sync,[:user_names] => [:environment] do |task,args|
|
||||
if args.user_names
|
||||
users = User.where(:user_name.in=>YAML.load(args.user_names)).to_a
|
||||
else
|
||||
users = User.all.to_a
|
||||
end
|
||||
users.each do |user|
|
||||
puts "Fetching data for #{user.user_name}..."
|
||||
query_result = get_sync_data(user.user_name)
|
||||
|
|
Loading…
Reference in New Issue