aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/table.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-11-29 17:22:17 -0700
committerSean Griffin <sean@thoughtbot.com>2014-11-29 17:22:17 -0700
commit98fc25991137ee09b6800578117f8c1c322680f2 (patch)
tree038381ae4465d6ea9950ecda9ef10822fd3ff9c6 /lib/arel/table.rb
parent7508284800f67b4611c767bff9eae7045674b66f (diff)
downloadrails-98fc25991137ee09b6800578117f8c1c322680f2.tar.gz
rails-98fc25991137ee09b6800578117f8c1c322680f2.tar.bz2
rails-98fc25991137ee09b6800578117f8c1c322680f2.zip
Remove `engine` from `TreeManager` and subclasses
This constructor parameter was unused for everything except the convenience methods `to_sql` and `where_sql`. We can pass the engine into those methods directly.
Diffstat (limited to 'lib/arel/table.rb')
-rw-r--r--lib/arel/table.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/arel/table.rb b/lib/arel/table.rb
index d534c44fa1..2c7a2b7f93 100644
--- a/lib/arel/table.rb
+++ b/lib/arel/table.rb
@@ -6,7 +6,7 @@ module Arel
@engine = nil
class << self; attr_accessor :engine; end
- attr_accessor :name, :engine, :aliases, :table_alias
+ attr_accessor :name, :aliases, :table_alias
# TableAlias and Table both have a #table_name which is the name of the underlying table
alias :table_name :name
@@ -15,7 +15,6 @@ module Arel
@name = name.to_s
@columns = nil
@aliases = []
- @engine = Table.engine
# Sometime AR sends an :as parameter to table, to let the table know
# that it is an Alias. We may want to override new, and return a
@@ -32,8 +31,8 @@ module Arel
end
end
- def from engine = Table.engine
- SelectManager.new(engine, self)
+ def from
+ SelectManager.new(self)
end
def join relation, klass = Nodes::InnerJoin