Skip to content

ActiveRecord/ActiveSupport does not cast time values stored as Unix epoch in SQLite3 back to Time objects #2028

@sgerrand

Description

@sgerrand

After upgrading a Rails app (from 2.3.11 to 2.3.12) that uses Authlogic 2.1.6, I'm getting exceptions raised by the setup method used in my functional tests.

ArgumentError: comparison of ActiveSupport::TimeWithZone with 1310341488 failed
    authlogic (2.1.6) lib/authlogic/session/magic_columns.rb:82:in `>='
    authlogic (2.1.6) lib/authlogic/session/magic_columns.rb:82:in `set_last_request_at?'
    authlogic (2.1.6) lib/authlogic/session/callbacks.rb:83:in `before_save'
    authlogic (2.1.6) lib/authlogic/session/existence.rb:68:in `save'
    authlogic (2.1.6) lib/authlogic/session/existence.rb:30:in `create'
    /test/test_helper.rb:53:in `setup'

This looks like an ActiveRecord issue regarding casting time values stored as Unix epoch in SQLite3 back to a Time object,.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions