aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/class_methods/join_dependency/join_part.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-11-24 13:53:55 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-24 13:55:56 -0800
commit34d21b87bb237bf55214bd476be71116a2a5258f (patch)
treed5129002b762d702cd34b6c54b440290012feb1f /activerecord/lib/active_record/associations/class_methods/join_dependency/join_part.rb
parentcdf6cf01cb47bdcbc1e011c8f5f72b161f12bf9c (diff)
downloadrails-34d21b87bb237bf55214bd476be71116a2a5258f.tar.gz
rails-34d21b87bb237bf55214bd476be71116a2a5258f.tar.bz2
rails-34d21b87bb237bf55214bd476be71116a2a5258f.zip
adding a factory method to the join part for generating a table alias
Diffstat (limited to 'activerecord/lib/active_record/associations/class_methods/join_dependency/join_part.rb')
-rw-r--r--activerecord/lib/active_record/associations/class_methods/join_dependency/join_part.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/class_methods/join_dependency/join_part.rb b/activerecord/lib/active_record/associations/class_methods/join_dependency/join_part.rb
index 64d751344d..5d55ca202e 100644
--- a/activerecord/lib/active_record/associations/class_methods/join_dependency/join_part.rb
+++ b/activerecord/lib/active_record/associations/class_methods/join_dependency/join_part.rb
@@ -21,6 +21,10 @@ module ActiveRecord
@cached_record = {}
end
+ def aliased_table
+ Arel::Nodes::TableAlias.new aliased_table_name, table
+ end
+
def ==(other)
raise NotImplementedError
end