{"action":"created","issue":{"url":"https://api.github.com/repos/ctran/annotate_models/issues/231","labels_url":"https://api.github.com/repos/ctran/annotate_models/issues/231/labels{/name}","comments_url":"https://api.github.com/repos/ctran/annotate_models/issues/231/comments","events_url":"https://api.github.com/repos/ctran/annotate_models/issues/231/events","html_url":"https://github.com/ctran/annotate_models/pull/231","id":58177512,"number":231,"title":"Prefer SQL column type over normalized AR type","user":{"login":"vassilevsky","id":252023,"avatar_url":"https://avatars.githubusercontent.com/u/252023?v=3","gravatar_id":"","url":"https://api.github.com/users/vassilevsky","html_url":"https://github.com/vassilevsky","followers_url":"https://api.github.com/users/vassilevsky/followers","following_url":"https://api.github.com/users/vassilevsky/following{/other_user}","gists_url":"https://api.github.com/users/vassilevsky/gists{/gist_id}","starred_url":"https://api.github.com/users/vassilevsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vassilevsky/subscriptions","organizations_url":"https://api.github.com/users/vassilevsky/orgs","repos_url":"https://api.github.com/users/vassilevsky/repos","events_url":"https://api.github.com/users/vassilevsky/events{/privacy}","received_events_url":"https://api.github.com/users/vassilevsky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-19T07:52:46Z","updated_at":"2015-03-17T13:39:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ctran/annotate_models/pulls/231","html_url":"https://github.com/ctran/annotate_models/pull/231","diff_url":"https://github.com/ctran/annotate_models/pull/231.diff","patch_url":"https://github.com/ctran/annotate_models/pull/231.patch"},"body":"We have columns of type `point` in our PostgreSQL database:\r\n\r\n```\r\n#<ActiveRecord::ConnectionAdapters::PostgreSQLColumn:0x007ffd7b829aa8\r\n @coder=nil,\r\n @default=nil,\r\n @limit=nil,\r\n @name=\"point\",\r\n @null=false,\r\n @precision=nil,\r\n @primary=false,\r\n @scale=nil,\r\n @sql_type=\"point\",\r\n @type=:string>\r\n```\r\n\r\nhttp://www.postgresql.org/docs/9.4/interactive/datatype-geometric.html\r\n\r\nThey are annotated as `string` in our models. This is misleading: `point` is actually 2 floats; not even close to a string.\r\n\r\nI thought that SQL type should take precedence.\r\n\r\nI understand that this change may be not enough or is completely wrong, and would welcome suggestions on the best solution."},"comment":{"url":"https://api.github.com/repos/ctran/annotate_models/issues/comments/82357169","html_url":"https://github.com/ctran/annotate_models/pull/231#issuecomment-82357169","issue_url":"https://api.github.com/repos/ctran/annotate_models/issues/231","id":82357169,"user":{"login":"alexch","id":8524,"avatar_url":"https://avatars.githubusercontent.com/u/8524?v=3","gravatar_id":"","url":"https://api.github.com/users/alexch","html_url":"https://github.com/alexch","followers_url":"https://api.github.com/users/alexch/followers","following_url":"https://api.github.com/users/alexch/following{/other_user}","gists_url":"https://api.github.com/users/alexch/gists{/gist_id}","starred_url":"https://api.github.com/users/alexch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexch/subscriptions","organizations_url":"https://api.github.com/users/alexch/orgs","repos_url":"https://api.github.com/users/alexch/repos","events_url":"https://api.github.com/users/alexch/events{/privacy}","received_events_url":"https://api.github.com/users/alexch/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T13:39:43Z","updated_at":"2015-03-17T13:39:43Z","body":"I'm intrigued. How is a point specified in an AR schema or migration?\n\nAs a compromise, we could add the sql_type in parens if it's different from\nthe AR type.\n"}}