{"action":"opened","issue":{"url":"https://api.github.com/repos/rails/arel/issues/399","labels_url":"https://api.github.com/repos/rails/arel/issues/399/labels{/name}","comments_url":"https://api.github.com/repos/rails/arel/issues/399/comments","events_url":"https://api.github.com/repos/rails/arel/issues/399/events","html_url":"https://github.com/rails/arel/issues/399","id":115497478,"number":399,"title":"NamedFunction cannot be used for ordering anymore in arel 6","user":{"login":"fschwahn","id":57876,"avatar_url":"https://avatars.githubusercontent.com/u/57876?v=3","gravatar_id":"","url":"https://api.github.com/users/fschwahn","html_url":"https://github.com/fschwahn","followers_url":"https://api.github.com/users/fschwahn/followers","following_url":"https://api.github.com/users/fschwahn/following{/other_user}","gists_url":"https://api.github.com/users/fschwahn/gists{/gist_id}","starred_url":"https://api.github.com/users/fschwahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fschwahn/subscriptions","organizations_url":"https://api.github.com/users/fschwahn/orgs","repos_url":"https://api.github.com/users/fschwahn/repos","events_url":"https://api.github.com/users/fschwahn/events{/privacy}","received_events_url":"https://api.github.com/users/fschwahn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-06T12:40:54Z","updated_at":"2015-11-06T12:40:54Z","closed_at":null,"body":"Hi,\r\nwith arel 5 I could do the following:\r\n\r\n```ruby\r\nt = Arel::Table.new(:table)\r\nArel::Nodes::NamedFunction.new('CAST', [t[:date].as(\"TIME\")]).desc\r\n```\r\n\r\nWhich would allow me to order according to a named function. This does not work in arel 6 anymore:\r\n\r\n    undefined method `asc' for #<Arel::Nodes::NamedFunction:0x007fc858b977d8> (NoMethodError)\r\n\r\nIs there any reason this functionality was removed, or is this a regression?\r\n\r\nThe following can be used to reproduce:\r\n```ruby\r\n#!/usr/bin/env ruby\r\n\r\nbegin\r\n  require 'bundler/inline'\r\nrescue LoadError => e\r\n  $stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'\r\n  raise e\r\nend\r\n\r\ngemfile(true) do\r\n  source 'https://rubygems.org'\r\n  gem 'sqlite3'\r\n\r\n  # Arel 6\r\n  gem 'activerecord', '~> 4.2', require: 'active_record'\r\n  gem 'arel', '~> 6.0'\r\n\r\n  # Arel 5\r\n  # gem 'activerecord', '~> 4.1', require: 'active_record'\r\n  # gem 'arel', '~> 5.0'\r\nend\r\n\r\nActiveRecord::Base.establish_connection(adapter: \"sqlite3\", database: \":memory:\")\r\n\r\nt = Arel::Table.new(:table, ActiveRecord::Base)\r\nputs Arel::Nodes::NamedFunction.new('CAST', [t[:date].as(\"TIME\")]).desc.to_sql\r\n```\r\n\r\nAll the best,\r\nFabian"}}