What else are you calling from your observer, or whatever is
triggering this call? Also, looks like the xss_terminate pluginmight
have something to do with it, try commenting out the xss_terminate
hooks.
On Mon, Oct 20, 2008 at 12:56 PM, vincent chu <vincentchu at gmail.com>
wrote:> Hi all -
>
> I''ve been having some trouble registering newsfeed posts.
I''ve been
> adapting the code used in the tutorial but have been getting some
> errors (see below). This is really strange because this code is
> essentially the same as some other code which I was able to run
> successfully. The error messages are pretty cryptic to me -- any
> suggestions?
>
> Thanks,
>
> Vince
>
> Here''s what happens when I try to register a feed:
>
>>> FacebookUserPublisher.register_feed
> NoMethodError: undefined method `empty?'' for 31659081545:Bignum
> from
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.1/lib/action_controller/vendor/html-scanner/html/sanitizer.rb:9:in
> `sanitizeable?''
> from
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.1/lib/action_controller/vendor/html-scanner/html/sanitizer.rb:4:in
> `sanitize''
> from
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.1/lib/action_controller/vendor/html-scanner/html/sanitizer.rb:30:in
> `sanitize''
> from
/Users/vincentc/projects/rails/src-posterous/posterous-facebook/vendor/plugins/xss_terminate/lib/xss_terminate.rb:40:in
> `sanitize_fields''
> from
/Users/vincentc/projects/rails/src-posterous/posterous-facebook/vendor/plugins/xss_terminate/lib/xss_terminate.rb:27:in
> `each''
> from
/Users/vincentc/projects/rails/src-posterous/posterous-facebook/vendor/plugins/xss_terminate/lib/xss_terminate.rb:27:in
> `sanitize_fields''
> from
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/callbacks.rb:173:in
> `send''
> from
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/callbacks.rb:173:in
> `evaluate_method''
> from
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/callbacks.rb:161:in
> `call''
> from
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/callbacks.rb:93:in
> `run''
> from
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/callbacks.rb:92:in
> `each''
> from
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/callbacks.rb:92:in
> `send''
> from
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/callbacks.rb:92:in
> `run''
> from
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/callbacks.rb:272:in
> `run_callbacks''
> from
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/callbacks.rb:298:in
> `callback''
> from
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/callbacks.rb:206:in
> `create_or_update''
> from
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:2211:in
> `save_without_validation''
> from
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/validations.rb:911:in
> `save_without_dirty''
> from
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/dirty.rb:75:in
> `save_without_transactions''
> from
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/transactions.rb:106:in
> `save''
> from
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in
> `transaction''
> from
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/transactions.rb:79:in
> `transaction''
> from
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/transactions.rb:98:in
> `transaction''
> from
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/transactions.rb:106:in
> `save''
> from
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/transactions.rb:118:in
> `rollback_active_record_state!''
> from
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/transactions.rb:106:in
> `save''
> from
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/validations.rb:932:in
> `update_attribute''
> from
/Users/vincentc/projects/rails/src-posterous/posterous-facebook/vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:114:in
> `register''
> from
/Users/vincentc/projects/rails/src-posterous/posterous-facebook/vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:371:in
> `method_missing''
> from (irb):9
> from :0>>
>
> Here''s the corresponding source code for the FacebookUserPublisher
class:
>
> class FacebookUserPublisher < Facebooker::Rails::Publisher
>
> def feed_template
>
> # A shorter, less information dense template for facebook aggregation
> one_line_story_template "{*actor*} posted to his blog"
>
> end
>
> def feed(user)
>
> send_as :user_action
> from user.facebook_session.user
> data {}
>
> end
>
> def profile_update(fb_user)
>
> send_as :profile
> recipients fb_user
> profile_main render(:partial =>
"facebook_users/fb_profile",
> :assigns => {:fb_user => fb_user})
>
> end
>
>
>
>
> end
> _______________________________________________
> Facebooker-talk mailing list
> Facebooker-talk at rubyforge.org
> http://rubyforge.org/mailman/listinfo/facebooker-talk
>