Today I’ve stumbled on a clearly annoying behavior of ActiveRecord. Basically the problem is that, when given a long as parameters for a timestamp in the constructor, it silently skips it and put nil instead.

irb(main):031:0* Example.new(timestamp: 1460398398)
=> #<Example id: nil, timestamp: nil>
irb(main):031:0* Example.new(timestamp: Time.at(1460398398))
=> #<Example id: nil, timestamp: "2016-04-11 18:13:18">

ActiveRecord is full of surprises …