我刚刚打破了我现有的从延迟工作中获取咆哮式通知的方式,并且打开别人的宝石并四处乱窜并没有让我到任何地方。所以我想知道:从后台任务获取通知的明智方法是什么。目前我正在使用带有这样的 ruby 类的gritter_notices(但我已经做了一些事情来阻止它工作......并且文档不是我的母语......)
#User.rb
has_gritter_notices
class DoThing
def run_thing(books, template, client, user)
# some code
User.find(user).notice "<a href='/archives' target='_blank'>View Archive</a>", :level => :notice, :sticky => true, :title => "Things generated."
end
handle_asynchronously :run_thing
end
ps 我得到的错误是ActiveRecord::RecordInvalid: Validation failed: Text can't be blank
.