2012-09-06 153 views
-1

我刚刚打破了我从delayed_job获取咆哮式通知的现有方式,并打开别人的宝石和黑客入侵并没有让我到任何地方。所以我想知道:从后台任务获取通知的明智方式是什么。目前我使用gritter_notices用Ruby类这样的(但我做了什么来阻止它的工作...和文档是不是我的母语...)从延迟工作咆哮通知

#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

回答

0

哦,不理我。我打开whitelist_attributes:

config.active_record.whitelist_attributes = true 

和创业板不具有attr_accessible白名单及其属性。