ruhoh / ruhoh.rb

http://ruhoh.com
616 stars 67 forks source link

RSS feed not picking up post description #182

Closed davedoesdev closed 11 years ago

davedoesdev commented 11 years ago

(Ruhoh 2.2)

resources/pages/compiler.rb has this:

xml.description_ (page.try(:description) ? page.description : view.render_content)

However, my feed always has the full content in, not the page's description

If I do this just before the line above:

puts page.description

Then I see the description

However,

puts page.try(:description)

returns nil. Something wrong with page.try I think - is page a BasicObject?

davedoesdev commented 11 years ago

try (base/model.rb) should read:

def try(method)
  return __send__(method) if respond_to?(method)
  return data[method.to_s] if data.key?(method.to_s)
  false

At the moment, it's:

def try(method)
  return __send__(method) if respond_to?(method)
  return data[method] if data.key?(method.to_s)
  false
end
plusjade commented 11 years ago

Sorry guys, that implementation is an artifact of some major code refactoring..I'm not entirely sure we still need it but @davedoesdev fix looks good nonetheless!

davedoesdev commented 11 years ago

It's nice to be able to have the description in the rss feed instead of the content - really I want subscribers just to see a short precis. A lot of the formatting isn't going to carry across to feedly or innoreader (let alone some native app) anyway.

Btw I've ported the hooligan theme to RuhohSpec 2.1