Tim Connor
2007-Apr-23 03:43 UTC
Should resource_feeder render_rss_feed_for choke on date (instead of datetime)
I guess I''ll work around it with a lamda and a to_time, for now, but to_s(:rfc822) exists in the rails time extensions, but not the date extensions, so if you try to use a date field for pub_date it chokes. My uncertainty is if to_s(:rfc822) should be added to Date (do a to_time, first?) or if resource_feeder should check before doing the to_s(:rfc822). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Tim Connor
2007-Apr-23 05:26 UTC
Re: Should resource_feeder render_rss_feed_for choke on date (instead of datetime)
Please ignore. I still think it''s a cryptic error to throw on a nil, but there was a mistake in my code/data. to_s(:rfc822) works fine on a date field, as long as it isn''t null/nil. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Tim Connor
2007-Apr-23 07:22 UTC
Re: Should resource_feeder render_rss_feed_for choke on date (instead of datetime)
I wonder if nil.to_s should be extended to accept an optional parameter and still throw the nil exception, to make errors on nil.to_s with the Rails extensions less obscure? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Tim Connor
2007-Apr-23 08:44 UTC
Re: Should resource_feeder render_rss_feed_for choke on date (instead of datetime) [PATCH]
I made a tiny patch (with tests of course) that calls to_time before to_s(:rfc822). This means if pub_date is just a date, not a full datetime, the feed will still be valid. As a side-effect, you get a less cryptic nil error. The patch also fixes a failing test on resource_feeder, at least on my OS X system (running edge of course): test_should_allow_content_encoded_for_items http://dev.rubyonrails.org/ticket/8152 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---