parolkar的pfeed插件
我已经使用parolker的pfeed
插件来记录用户活动,但在保存Feed时出错。 以下是显示的错误消息。
TypeError (wrong argument type nil (expected Data)): /Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/syck.rb:401:in `emit' /Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/syck.rb:401:in `quick_emit' /Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/syck/rubytypes.rb:40:in `to_yaml' vendor/plugins/pfeed/app/models/pfeed_item.rb:37:in `log' (eval):7:in `start_followup_with_pfeed' app/controllers/individuals_controller.rb:329:in `add_followup' /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/hoptoad_notifier-2.4.9/lib/hoptoad_notifier/rack.rb:27:in `call' /Users/me/.rvm/gems/ruby-1.9.2-p180@suga/gems/hoptoad_notifier-2.4.9/lib/hoptoad_notifier/user_informer.rb:12:in `call' :10:in `synchronize' /Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service' /Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run' /Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
错误消息指向pfeed_item.rb
第37
pfeed_item.rb
,即p_item.save!
我试过p_item.errors
但它返回空信息。
你们有什么想法吗?
提前致谢 :)
PS: Rails 2.3.5
和Ruby 1.9.2-p180
=========
Model: individual.rb def start_followup(ind_followup) puts "added follow-up" end def complete_followup(ind_followup) puts "completed follow-up" end emits_pfeeds :on => [:start_followup,:complete_followup] , :for => [:itself] # Note: if feed needs to be received by all users , you could use :for => [:all_in_its_class] receives_pfeed
模型方法从控制器调用为
@individual.start_followup(@followup)
除此之外,所有事情都以pfeeds完成。
链接地址: http://www.djcxy.com/p/41913.html