{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/25453","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/25453/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/25453/comments","events_url":"https://api.github.com/repos/rails/rails/issues/25453/events","html_url":"https://github.com/rails/rails/issues/25453","id":161302375,"number":25453,"title":"DateTime insertion on rails 5","user":{"login":"waghanza","id":1440729,"avatar_url":"https://avatars.githubusercontent.com/u/1440729?v=3","gravatar_id":"","url":"https://api.github.com/users/waghanza","html_url":"https://github.com/waghanza","followers_url":"https://api.github.com/users/waghanza/followers","following_url":"https://api.github.com/users/waghanza/following{/other_user}","gists_url":"https://api.github.com/users/waghanza/gists{/gist_id}","starred_url":"https://api.github.com/users/waghanza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waghanza/subscriptions","organizations_url":"https://api.github.com/users/waghanza/orgs","repos_url":"https://api.github.com/users/waghanza/repos","events_url":"https://api.github.com/users/waghanza/events{/privacy}","received_events_url":"https://api.github.com/users/waghanza/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rails/rails/labels/activerecord","name":"activerecord","color":"0b02e1"},{"url":"https://api.github.com/repos/rails/rails/labels/PostgreSQL","name":"PostgreSQL","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-20T21:39:17Z","updated_at":"2016-06-21T07:38:29Z","closed_at":null,"body":"Hi,\r\n\r\nI have a simple table **events** on a `postgresql` database\r\n\r\n| Column | Type | Modifier |\r\n| ---------- | ------ | ----------- |\r\n| id         | integer                     | not null default nextval('events_id_seq'::regclass) |\r\n| start_at   | timestamp without time zone | |\r\n| end_at     | timestamp without time zone | |\r\n\r\nand I want to create a new **record**\r\n\r\n~~~rails\r\nEvent.create!(end_at:DateTime.strptime(\"1464559200000\",\"%Q\"))\r\n~~~\r\n\r\nI expect to have an event create with a valid date.\r\n\r\non my `fedora` I have\r\n\r\n~~~ruby\r\n=> #<Event id: 2, start_at: nil, end_at: \"2016-05-29 22:00:00\">\r\n~~~\r\n\r\nand on a `debian`\r\n\r\n~~~ruby\r\n=> #<Event id: 2, start_at: nil, end_at: nil>\r\n~~~\r\n\r\n+ **Ruby** version : `ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]`\r\n+ **Rails** version :  `Rails 5.0.0.rc1`\r\n+ **PostgreSQL** version: `psql (PostgreSQL) 9.5.3`\r\n\r\nI  have made this test, and it seems to be successful\r\n\r\n~~~ruby\r\nbegin\r\n  require 'bundler/inline'\r\nrescue LoadError => e\r\n  $stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'\r\n  raise e\r\nend\r\n\r\ngemfile(true) do\r\n  source 'https://rubygems.org'\r\n  gem \"rails\", \">= 5.0.0.rc1\", \"< 5.1\"\r\n  gem \"pg\", \"~> 0.18.4\"\r\nend\r\n\r\nrequire \"active_record\"\r\nrequire \"minitest/autorun\"\r\nrequire \"logger\"\r\nrequire \"date\"\r\n\r\n# This connection will do for database-independent bug reports.\r\nActiveRecord::Base.establish_connection(adapter: \"postgresql\", database: \"test\", username: \"postgres\")\r\nActiveRecord::Base.logger = Logger.new(STDOUT)\r\n\r\nActiveRecord::Schema.define do\r\n  create_table :events do |t|\r\n    t.timestamp :start_at\r\n    t.timestamp :end_at\r\n  end\r\nend\r\n\r\nclass Event < ActiveRecord::Base\r\nend\r\n\r\nclass BugTest < Minitest::Test\r\n  def setup\r\n    @event = Event.create!(dt: DateTime.strptime(\"1464559200000\",\"%Q\"))\r\n  end\r\n\r\n  def test_datetime\r\n    assert_respond_to @event.dt, \"to_f\", \"Could not get float from #{@event.dt}\"\r\n  end\r\nend\r\n~~~"},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/227363712","html_url":"https://github.com/rails/rails/issues/25453#issuecomment-227363712","issue_url":"https://api.github.com/repos/rails/rails/issues/25453","id":227363712,"user":{"login":"waghanza","id":1440729,"avatar_url":"https://avatars.githubusercontent.com/u/1440729?v=3","gravatar_id":"","url":"https://api.github.com/users/waghanza","html_url":"https://github.com/waghanza","followers_url":"https://api.github.com/users/waghanza/followers","following_url":"https://api.github.com/users/waghanza/following{/other_user}","gists_url":"https://api.github.com/users/waghanza/gists{/gist_id}","starred_url":"https://api.github.com/users/waghanza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waghanza/subscriptions","organizations_url":"https://api.github.com/users/waghanza/orgs","repos_url":"https://api.github.com/users/waghanza/repos","events_url":"https://api.github.com/users/waghanza/events{/privacy}","received_events_url":"https://api.github.com/users/waghanza/received_events","type":"User","site_admin":false},"created_at":"2016-06-21T07:38:29Z","updated_at":"2016-06-21T07:38:29Z","body":"~~~rails\r\nEvent.create!(end_at: DateTime.strptime(\"1464559200000\",\"%Q\"))\r\n~~~\r\n**work** on a newly create `rails` **5** project"}}
{"actor":{"display_login":"waghanza"}}