1
Postgres 9.0.4
Rails 3.0.7
AR 3.0.7
pg 0.12.2

I have a table with 3 records in it with DATE column values of '0001-01-01 BC' (not sure how they got in there in the first place, there is no default value set on the column).

When I request these records and then query for this date column value through ActiveRelation, they return nil, but they are actually NOT NULL in the database.

See:

[3] pry(main)> User.where(birthday: '0001-01-01 BC').map {|u| u.birthday}
=> [nil, nil, nil]

Anyone seen anything like this or have any idea what's going on here?

Thanks, Wes

Levon
  • 138,105
  • 33
  • 200
  • 191
Wes Gamble
  • 777
  • 10
  • 29

1 Answers1

2

This looks like an issue that was fixed with this pull request. Updating rails should solve your problem.

Nick Colgan
  • 5,488
  • 25
  • 36