diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-29 12:13:26 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-29 12:13:26 -0700 |
commit | f87c8398d95f3f4b162a3a78299489189d7a0a45 (patch) | |
tree | 467e2fbfad76111a3739619427caaefdfdf4debf /lib/arel | |
parent | 068b184a59a98b4acdc63a2833c360199d138c1d (diff) | |
download | rails-f87c8398d95f3f4b162a3a78299489189d7a0a45.tar.gz rails-f87c8398d95f3f4b162a3a78299489189d7a0a45.tar.bz2 rails-f87c8398d95f3f4b162a3a78299489189d7a0a45.zip |
PERF: pushing christener down for faster method lookup and calling
Diffstat (limited to 'lib/arel')
-rw-r--r-- | lib/arel/algebra/relations/operations/project.rb | 3 | ||||
-rw-r--r-- | lib/arel/engines/sql/relations/table.rb | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/arel/algebra/relations/operations/project.rb b/lib/arel/algebra/relations/operations/project.rb index 649ec19713..1c24ae6caf 100644 --- a/lib/arel/algebra/relations/operations/project.rb +++ b/lib/arel/algebra/relations/operations/project.rb @@ -1,10 +1,11 @@ module Arel class Project < Compound - attr_reader :projections, :attributes + attr_reader :projections, :attributes, :christener def initialize(relation, projections) super(relation) @projections = projections.map { |p| p.bind(relation) } + @christener = Sql::Christener.new @attributes = Header.new(projections.map { |x| x.bind(self) }) end diff --git a/lib/arel/engines/sql/relations/table.rb b/lib/arel/engines/sql/relations/table.rb index 65a0f91e8c..f56fd7d813 100644 --- a/lib/arel/engines/sql/relations/table.rb +++ b/lib/arel/engines/sql/relations/table.rb @@ -12,12 +12,13 @@ module Arel def tables= e; @@tables = e; end end - attr_reader :name, :engine, :table_alias, :options + attr_reader :name, :engine, :table_alias, :options, :christener def initialize(name, options = {}) @name = name.to_s @table_exists = nil @table_alias = nil + @christener = Sql::Christener.new if options.is_a?(Hash) @options = options |