Skip to content

Instantly share code, notes, and snippets.

@rafaelfranca
Created February 10, 2014 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelfranca/8924019 to your computer and use it in GitHub Desktop.
Save rafaelfranca/8924019 to your computer and use it in GitHub Desktop.
diff --git a/lib/arel.rb b/lib/arel.rb
index a2a3588..70b46fc 100644
--- a/lib/arel.rb
+++ b/lib/arel.rb
@@ -11,10 +11,6 @@ require 'arel/table'
require 'arel/attributes'
require 'arel/compatibility/wheres'
-#### these are deprecated
-require 'arel/expression'
-####
-
require 'arel/visitors'
require 'arel/tree_manager'
diff --git a/lib/arel/expression.rb b/lib/arel/expression.rb
deleted file mode 100644
index 3884d6e..0000000
--- a/lib/arel/expression.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module Arel
- module Expression
- include Arel::OrderPredications
- end
-end
diff --git a/lib/arel/nodes/extract.rb b/lib/arel/nodes/extract.rb
index 92fbde6..64f5c3f 100644
--- a/lib/arel/nodes/extract.rb
+++ b/lib/arel/nodes/extract.rb
@@ -1,8 +1,6 @@
module Arel
module Nodes
-
class Extract < Arel::Nodes::Unary
- include Arel::Expression
include Arel::Predications
attr_accessor :field
diff --git a/lib/arel/nodes/function.rb b/lib/arel/nodes/function.rb
index dcafbbf..733a00d 100644
--- a/lib/arel/nodes/function.rb
+++ b/lib/arel/nodes/function.rb
@@ -1,7 +1,6 @@
module Arel
module Nodes
class Function < Arel::Nodes::Node
- include Arel::Expression
include Arel::Predications
include Arel::WindowPredications
attr_accessor :expressions, :alias, :distinct
diff --git a/lib/arel/nodes/window.rb b/lib/arel/nodes/window.rb
index 3c05f47..60259e8 100644
--- a/lib/arel/nodes/window.rb
+++ b/lib/arel/nodes/window.rb
@@ -1,7 +1,6 @@
module Arel
module Nodes
class Window < Arel::Nodes::Node
- include Arel::Expression
attr_accessor :orders, :framing
def initialize
diff --git a/test/nodes/test_count.rb b/test/nodes/test_count.rb
index 88d2a69..a9a3294 100644
--- a/test/nodes/test_count.rb
+++ b/test/nodes/test_count.rb
@@ -1,12 +1,6 @@
require 'helper'
describe Arel::Nodes::Count do
- describe 'backwards compatibility' do
- it 'must be an expression' do
- Arel::Nodes::Count.new('foo').must_be_kind_of Arel::Expression
- end
- end
-
describe "as" do
it 'should alias the count' do
table = Arel::Table.new :users
diff --git a/test/test_select_manager.rb b/test/test_select_manager.rb
index c1575a7..cf8903a 100644
--- a/test/test_select_manager.rb
+++ b/test/test_select_manager.rb
@@ -449,18 +449,6 @@ module Arel
SELECT * FROM "users" ORDER BY "users"."id" DESC
}
end
-
- it 'has order attributes for expressions' do
- table = Table.new :users
- manager = Arel::SelectManager.new Table.engine
- manager.project Nodes::SqlLiteral.new '*'
- manager.from table
- manager.order table[:id].count.desc
- manager.to_sql.must_be_like %{
- SELECT * FROM "users" ORDER BY COUNT("users"."id") DESC
- }
- end
-
end
describe 'on' do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment