{"action":"opened","issue":{"url":"https://api.github.com/repos/plataformatec/simple_form/issues/1362","repository_url":"https://api.github.com/repos/plataformatec/simple_form","labels_url":"https://api.github.com/repos/plataformatec/simple_form/issues/1362/labels{/name}","comments_url":"https://api.github.com/repos/plataformatec/simple_form/issues/1362/comments","events_url":"https://api.github.com/repos/plataformatec/simple_form/issues/1362/events","html_url":"https://github.com/plataformatec/simple_form/issues/1362","id":136115141,"number":1362,"title":"Possible issue with f.input for ActiveSupport::TimeWithZone as: boolean","user":{"login":"davetchen","id":755162,"avatar_url":"https://avatars.githubusercontent.com/u/755162?v=3","gravatar_id":"","url":"https://api.github.com/users/davetchen","html_url":"https://github.com/davetchen","followers_url":"https://api.github.com/users/davetchen/followers","following_url":"https://api.github.com/users/davetchen/following{/other_user}","gists_url":"https://api.github.com/users/davetchen/gists{/gist_id}","starred_url":"https://api.github.com/users/davetchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davetchen/subscriptions","organizations_url":"https://api.github.com/users/davetchen/orgs","repos_url":"https://api.github.com/users/davetchen/repos","events_url":"https://api.github.com/users/davetchen/events{/privacy}","received_events_url":"https://api.github.com/users/davetchen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-24T16:37:53Z","updated_at":"2016-02-24T16:37:53Z","closed_at":null,"body":"I'm seeing an issue upgrading from Rails 3 to Rails 4.2.5 and SimpleForm v 3.2.1\r\n\r\nI'm trying to provide a checkbox for a User form that exposes the Devise :confirmed_at column. The default checkbox value does not seem to be set properly in this case\r\n```\r\n> @user.confirmed_at.class\r\n => ActiveSupport::TimeWithZone\r\n```\r\n\r\nAnd in the simple_form\r\n```\r\n = f.input :confirmed_at, :as => :boolean,\r\n    :label => t('admin.users.edit.confirmed_at')\r\n```\r\n\r\nThe \"value\" attribute for the generated input looks OK but the \"checked\" attribute does not get defined. Here is my simple (but verbose) work around\r\n```\r\n  -# possible bug with simple_form\r\n  -if @user.confirmed_at\r\n    = f.input :confirmed_at, :as => :boolean,\r\n      :label => t('admin.users.edit.confirmed_at'),\r\n      input_html: { checked: \"checked\" }\r\n  -else\r\n    = f.input :confirmed_at, :as => :boolean,\r\n      :label => t('admin.users.edit.confirmed_at')\r\n```\r\n\r\nMy User model has other :boolean columns where this input works fine so my guess is that the problem is with the ``@user.confirmed_at.class``\r\n\r\nAgain, all this worked OK under Rails 3 and SimpleForm v 2.0.1"}}