Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Start / End Time translation breaks in Ruby 1.9.2

#134

You can't create content in Ruby 1.9.2. The start_time and end_time attribute accessors attempt to parse a hash into a date but this fails in Ruby 1.9.2.

ArgumentError in ContentsController#create

argument out of range
Rails.root: /Users/bamnet/Documents/work/concerto

Application Trace | Framework Trace | Full Trace
app/models/content.rb:51:in end_time=' app/controllers/contents_controller.rb:77:innew'
app/controllers/contents_controller.rb:77:in `create'
Request

Parameters:

{"utf8"=>"✓", "authenticity_token"=>"h7Ea8Z0IvEPedkITESQ1ucXHDAQOiru6Vh3+/+PylXg=", "ticker"=>{"data"=>"This is a test", "name"=>"", "duration"=>"8", "start_time"=>{"date"=>"04/12/2011", "time"=>"12:00 am"}, "end_time"=>{"date"=>"04/20/2011", "time"=>"11:59 pm"}, "user_id"=>"1"}, "type"=>"Ticker", "commit"=>"Create Ticker"}

Reported by Brian Michalski · April 13th, 2011 @ 02:28 AM

State: resolved
Milestone: none
Assigned to: August August

Activity

  1. August
    August
    • State changed from open to resolved
    • Assigned user changed from Brian Michalski to August

    Ruby 1.9 deliberately changed this behavior to comply with Euro/ISO standards. Using strptime and specifying the conventions being used seems to have worked. Committed.

    April 15th, 2011 @ 12:19 AM

  2. Brian Michalski
    Brian Michalski
    • State changed from resolved to open

    I'm going to open this up for now, I have an offending test case I want to commit and not forget about. Small nuances like this in Ruby versions could definitely come back to haunt us later if we forget about them...

    April 15th, 2011 @ 11:59 AM

  3. Brian Michalski
    Brian Michalski
    • State changed from open to resolved

    April 25th, 2011 @ 07:40 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.