{"action":"created","issue":{"url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/570","labels_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/570/labels{/name}","comments_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/570/comments","events_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/570/events","html_url":"https://github.com/activerecord-hackery/ransack/issues/570","id":97914251,"number":570,"title":"PG::InvalidDatetimeFormat when using _present","user":{"login":"JFimex","id":9335179,"avatar_url":"https://avatars.githubusercontent.com/u/9335179?v=3","gravatar_id":"","url":"https://api.github.com/users/JFimex","html_url":"https://github.com/JFimex","followers_url":"https://api.github.com/users/JFimex/followers","following_url":"https://api.github.com/users/JFimex/following{/other_user}","gists_url":"https://api.github.com/users/JFimex/gists{/gist_id}","starred_url":"https://api.github.com/users/JFimex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JFimex/subscriptions","organizations_url":"https://api.github.com/users/JFimex/orgs","repos_url":"https://api.github.com/users/JFimex/repos","events_url":"https://api.github.com/users/JFimex/events{/privacy}","received_events_url":"https://api.github.com/users/JFimex/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-29T11:16:51Z","updated_at":"2015-07-30T13:31:52Z","closed_at":null,"body":"I am not 100% sure whether this is a bug or a misconfiguration on my part\r\nransack version: 1.6.6\r\n\r\nI have a model Order that has the migration:     \r\n      t.date :completed_on\r\n      #irreverent others\r\n\r\nOrder.ransack(completed_on_present: false).result.to_sql\r\n#SELECT \"orders\".* FROM \"orders\" WHERE (\"orders\".\"completed_on\" IS NULL OR \"orders\".\"completed_on\" = '')\r\n#throws PG::InvalidDatetimeFormat \r\n\r\nwhereas the activerecord equivalent is\r\nOrder.where(completed_on: nil).to_sql\r\n#SELECT \"orders\".* FROM \"orders\" WHERE \"orders\".\"completed_on\" IS NULL\r\n"},"comment":{"url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/comments/126325026","html_url":"https://github.com/activerecord-hackery/ransack/issues/570#issuecomment-126325026","issue_url":"https://api.github.com/repos/activerecord-hackery/ransack/issues/570","id":126325026,"user":{"login":"ASnow","id":572218,"avatar_url":"https://avatars.githubusercontent.com/u/572218?v=3","gravatar_id":"","url":"https://api.github.com/users/ASnow","html_url":"https://github.com/ASnow","followers_url":"https://api.github.com/users/ASnow/followers","following_url":"https://api.github.com/users/ASnow/following{/other_user}","gists_url":"https://api.github.com/users/ASnow/gists{/gist_id}","starred_url":"https://api.github.com/users/ASnow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ASnow/subscriptions","organizations_url":"https://api.github.com/users/ASnow/orgs","repos_url":"https://api.github.com/users/ASnow/repos","events_url":"https://api.github.com/users/ASnow/events{/privacy}","received_events_url":"https://api.github.com/users/ASnow/received_events","type":"User","site_admin":false},"created_at":"2015-07-30T13:31:51Z","updated_at":"2015-07-30T13:31:51Z","body":"For second result you can write:\r\n``` ruby\r\nOrder.ransack(completed_on_null: true).result.to_sql\r\n```\r\nAs I see it's not bug because ransack don't validate column types"}}