Mike Mangino
2009-Jan-22 14:21 UTC
[Facebooker-talk] hashed_content method problem in short and full stories
I just added a fix for that. Try pulling down the latest version. Mike On Jan 22, 2009, at 4:02 PM, Jesse Ikonen wrote:> Hello, > > afaik I''m having issue with publisher.rb method called hashed_content. > > This is my UserPublisher template stuff: > > def question_template > one_line_story_template "{*actor*} asked a question in > {*app_link*}" > full_story_template "{*actor*} asked ''{*body*}'' in > {*app_link*}.", "Voting expires {*date*}." > end > > Following happens: > > >> UserPublisher.register_question > NoMethodError: undefined method `<=>'' for :template_title:Symbol > from ...vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb: > 180:in `sort_by'' > from ...vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb: > 180:in `hashed_content'' > from ...vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb: > 131:in `register'' > from ...vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb: > 451:in `method_missing'' > from (irb):1 > > If I have short_story_template it will break on line number 179. > > I think this has something to do with this commit @ github: > > - Digest::MD5.hexdigest > [publisher.one_line_story_templates, > publisher.short_story_templates, > publisher.full_story_template].to_json > + # sort the Hash elements (in the short_story and > full_story) before generating MD5 > + Digest::MD5.hexdigest > [publisher.one_line_story_templates, > + (publisher.short_story_templates and > publisher.short_story_templates.collect{|ss| ss.to_a.sort_by{|e| > e[0]}}), > + (publisher.full_story_template and > publisher.full_story_template.to_a.sort_by{|e| e[0]}) > + ].to_json > > Has anyone experienced same or any clue of what I''m doing wrong? > > Thanks! > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
Jesse Ikonen
2009-Jan-22 21:02 UTC
[Facebooker-talk] hashed_content method problem in short and full stories
Hello,
afaik I''m having issue with publisher.rb method called hashed_content.
This is my UserPublisher template stuff:
def question_template
one_line_story_template "{*actor*} asked a question in
{*app_link*}"
full_story_template "{*actor*} asked ''{*body*}'' in
{*app_link*}.", "Voting expires {*date*}."
end
Following happens:
>> UserPublisher.register_question
NoMethodError: undefined method `<=>'' for :template_title:Symbol
from ...vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:
180:in `sort_by''
from ...vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:
180:in `hashed_content''
from ...vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:
131:in `register''
from ...vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:
451:in `method_missing''
from (irb):1
If I have short_story_template it will break on line number 179.
I think this has something to do with this commit @ github:
- Digest::MD5.hexdigest
[publisher.one_line_story_templates, publisher.short_story_templates,
publisher.full_story_template].to_json
+ # sort the Hash elements (in the short_story and
full_story) before generating MD5
+ Digest::MD5.hexdigest [publisher.one_line_story_templates,
+ (publisher.short_story_templates and
publisher.short_story_templates.collect{|ss| ss.to_a.sort_by{|e|
e[0]}}),
+ (publisher.full_story_template and
publisher.full_story_template.to_a.sort_by{|e| e[0]})
+ ].to_json
Has anyone experienced same or any clue of what I''m doing wrong?
Thanks!