{"action":"closed","issue":{"url":"https://api.github.com/repos/rails-sqlserver/activerecord-sqlserver-adapter/issues/358","labels_url":"https://api.github.com/repos/rails-sqlserver/activerecord-sqlserver-adapter/issues/358/labels{/name}","comments_url":"https://api.github.com/repos/rails-sqlserver/activerecord-sqlserver-adapter/issues/358/comments","events_url":"https://api.github.com/repos/rails-sqlserver/activerecord-sqlserver-adapter/issues/358/events","html_url":"https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues/358","id":46438732,"number":358,"title":"Finding default order from a view fails trying to access Arel::Table#columns","user":{"login":"nickveys","id":135576,"avatar_url":"https://avatars.githubusercontent.com/u/135576?v=3","gravatar_id":"","url":"https://api.github.com/users/nickveys","html_url":"https://github.com/nickveys","followers_url":"https://api.github.com/users/nickveys/followers","following_url":"https://api.github.com/users/nickveys/following{/other_user}","gists_url":"https://api.github.com/users/nickveys/gists{/gist_id}","starred_url":"https://api.github.com/users/nickveys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickveys/subscriptions","organizations_url":"https://api.github.com/users/nickveys/orgs","repos_url":"https://api.github.com/users/nickveys/repos","events_url":"https://api.github.com/users/nickveys/events{/privacy}","received_events_url":"https://api.github.com/users/nickveys/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-10-21T20:10:49Z","updated_at":"2015-01-28T18:59:59Z","closed_at":"2015-01-28T18:59:59Z","body":"[Arel::Table#columns has been removed since 3.0](https://github.com/rails/arel/issues/65).  Active Record 4.1 depends on ~> 5.0.0, so it is long gone.  This causes a failure when trying to to call Arel::Visitors::SQLServer#rowtable_orders when querying a view with no `order` statements.  It ultimately tries to call `#columns`, failing since the method does not exist.\r\n\r\n    NoMethodError: undefined method `columns' for #<Arel::Table:0x00000118a82d70>\r\n    from ../lib/arel/visitors/sqlserver.rb:439:in `rowtable_orders'\r\n\r\nNote that this happens when a `SELECT TOP (X)` query is built, such as when using `will_paginate`, where order becomes important whether its specified in the query or not.  We can work around this by specifying a default order but using a removed method seems like a recipe for future failures."}}