{"action":"opened","issue":{"url":"https://api.github.com/repos/rom-rb/rom-sql/issues/80","repository_url":"https://api.github.com/repos/rom-rb/rom-sql","labels_url":"https://api.github.com/repos/rom-rb/rom-sql/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/rom-rb/rom-sql/issues/80/comments","events_url":"https://api.github.com/repos/rom-rb/rom-sql/issues/80/events","html_url":"https://github.com/rom-rb/rom-sql/issues/80","id":172438549,"number":80,"title":"Relation's schema doesn't work with custom coercion rules","user":{"login":"vbyno","id":2923624,"avatar_url":"https://avatars.githubusercontent.com/u/2923624?v=3","gravatar_id":"","url":"https://api.github.com/users/vbyno","html_url":"https://github.com/vbyno","followers_url":"https://api.github.com/users/vbyno/followers","following_url":"https://api.github.com/users/vbyno/following{/other_user}","gists_url":"https://api.github.com/users/vbyno/gists{/gist_id}","starred_url":"https://api.github.com/users/vbyno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbyno/subscriptions","organizations_url":"https://api.github.com/users/vbyno/orgs","repos_url":"https://api.github.com/users/vbyno/repos","events_url":"https://api.github.com/users/vbyno/events{/privacy}","received_events_url":"https://api.github.com/users/vbyno/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-22T12:19:25Z","updated_at":"2016-08-22T12:19:25Z","closed_at":null,"body":"I have a relation class:\r\n```\r\nclass Relation < ROM::Relation[:sql]                                                       \r\n  dataset :metrics\r\n  register_as :metrics_relation\r\n  \r\n  schema do                                                        \r\n    attribute :category, Types::String.default { 'default category' }\r\n  end\r\nend\r\n```\r\nWhen I try to insert new record into database I get an error:\r\n```\r\n=> metrics_relation.insert(params_hash.except(:category))\r\n=> Sequel::DatabaseError: Mysql2::Error: Field 'category' doesn't have a default value\r\nfrom /Users/vbyno/.rvm/gems/ruby-2.1.5@interface/gems/sequel-4.37.0/lib/sequel/adapters/mysql2.rb:137:in `query'\r\n```\r\n`infer: true` works as expected\r\n\r\nI use `rom-sql 0.8.0`, `rom-repository 0.3.1`, `dry-types 0.8.1`"}}
{"actor":{"display_login":"vbyno"}}