Topic.content returns an empy string with ruby-api
I'm using the api to grab some of the latest topics for our company on getsatisfaction with the ruby gem you guys developed. I seem to get the topics fine, iterating through each and doing topic.subject outputs the subject, but topic.content returns an empty string
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
-
Inappropriate?John,
You are probably haven't loaded the full data for the topic, let me explain w/ code:
sfn = Satisfaction.new
topic = sfn.topics.page(1).first
topic.content # => nil
topic.load
topic.content # => "foobar"
I'll push the content of topics into the top level feed so that this no longer occurs. until then, calling load on the topics you care about should work. I'll probably make the fix tonight
1 person says
this answers the question
-
Inappropriate?ah, very cool, i figured the lazy loading meant the first time you tried accessing a value it would load, not that you explicitly needed to call load. Another somewhat related issue, I want to be able to link back to the getsatisfaction topic, the url that is in the topic object links to the xml feed, going to http://getsatisfaction.com/company/to... gives me an error saying the topic doesn't exist.
I’m undecided
-
Inappropriate?We don't address topics on the getsatisfaction.com side using the raw id's. We use the SEO friendly slug.
This is a case where the JSON results are lagging a bit behind the Atom results. I'll add the slug into the json tonight and I'll add a helper method onto the gem to generate the correct url.
Thanks again,
Scott
1 person says
this answers the question
-
Inappropriate?awesome, thanks scott. was browsing the code on github earlier, looks like a very slick api wrapper you've developed btw
Loading Profile...



EMPLOYEE