parolkar的pfeed插件 - 保存Feed时出现问题

时间:2011-07-12 09:53:18

标签: ruby-on-rails ruby plugins ruby-on-rails-plugins

我使用了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'

错误消息指向37的行pfeed_item.rb p_item.save! 我尝试了p_item.errors,但它返回空消息。

你们有什么想法吗?

提前致谢:)

PS:Rails 2.3.5Ruby 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中完成。

0 个答案:

没有答案