我有一个 rake 任务
task :post_hit, [:host, :title, :description, :model, :num_assignments, :reward, :lifetime, :qualifications, :p, :opts] => :environment do |t, args|
:p
需要是一个哈希,但如果我尝试:
rake turkee:post_hit["http://www.staging.collegesportsbluebook.com","LS Info","Fill In Player First Name","MechanicalTurk",100,0.01,2,{},{id: 5},{}]
它错误地说id:
无法解析(空间似乎做了一些事情)。
如果我尝试:
rake turkee:post_hit["http://www.staging.collegesportsbluebook.com","LS Info","Fill In Player First Name","MechanicalTurk",100,0.01,2,{},{"id: 5"},{}]
who 字符串"id: 5"
被解释为单个字符串。
我们是否不允许将哈希传递给 rake 任务?