parolkar 的 pfeed 插件 - 保存 feed 时出现问题
我已经使用 parolker 的 pfeed
插件来记录用户活动,但在保存提要时遇到错误。下面是显示的错误消息。
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
行,即 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)
Beside这一切都是在 pfeed 中完成的。
I have used parolker's pfeed
plugin to log users activities but I am getting error while saving the feed. Below is the error message displayed.
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'
The error message points line 37
of pfeed_item.rb
which is p_item.save!
I tried p_item.errors
but it returns empty message.
Do you guys have any idea?
Thanks in advance :)
PS: Rails 2.3.5
and 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
The model method is called from controller as
@individual.start_followup(@followup)
Beside this everything is done in pfeeds.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论