FormidableLabs / jobboard

0 stars 2 forks source link

Display Date `strftime` exception #28

Closed alexlande closed 10 years ago

alexlande commented 10 years ago

@cherimarie: I'm getting an exception from display dates (see my comment on https://github.com/FormidableLabs/jobboard/commit/a1fc79a1e2c8c4060f60ae800a21dfd8df56b729)

undefined method `strftime' for nil:NilClass
app/views/shared/_listing_group.html.erb:15:in `block in _app_views_shared__listing_group_html_erb___1298722812077571329_70201617060180'
app/views/shared/_listing_group.html.erb:3:in `each'
app/views/shared/_listing_group.html.erb:3:in `_app_views_shared__listing_group_html_erb___1298722812077571329_70201617060180'
app/views/listings/search.html.erb:6:in `_app_views_listings_search_html_erb__578918294994601858_70201616892460'
cherimarie commented 10 years ago

Ah! The search function was searching all listings, not just approved ones. Unapproved listings have a date_approved of nil, so this method was throwing the exception when submitted but unapproved listings came back as search results. Good catch!

Fixed with commit d8bdb3c682cd507f851f01991ba9a0dd79182430