aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJoel Chippindale <joel.chippindale@gmail.com>2009-06-18 06:13:39 +0100
committerJoel Chippindale <joel.chippindale@gmail.com>2009-06-19 07:32:39 +0100
commitf9c6dcbf7cfbef6daad48dc6043a6dfaa09cf6b2 (patch)
treef6cb61ef07e7d8cfb491ad6f1ab09e54284cfbd9 /activerecord
parentd2dfd340e3b9beebb1d770c2f0fdbef97f8fb951 (diff)
downloadrails-f9c6dcbf7cfbef6daad48dc6043a6dfaa09cf6b2.tar.gz
rails-f9c6dcbf7cfbef6daad48dc6043a6dfaa09cf6b2.tar.bz2
rails-f9c6dcbf7cfbef6daad48dc6043a6dfaa09cf6b2.zip
Add documentation for qualifying table names in conditions hashes
Diffstat (limited to 'activerecord')
-rwxr-xr-xactiverecord/lib/active_record/base.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index f755c987c2..26ac2e0de4 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -236,6 +236,12 @@ module ActiveRecord #:nodoc:
#
# Student.find(:all, :conditions => { :grade => [9,11,12] })
#
+ # When joining tables, nested hashes or keys written in the form 'table_name.column_name' can be used to qualify the table name of a
+ # particular condition. For instance:
+ #
+ # Student.find(:all, :conditions => { :schools => { :type => 'public' }}, :joins => :schools)
+ # Student.find(:all, :conditions => { 'schools.type' => 'public' }, :joins => :schools)
+ #
# == Overwriting default accessors
#
# All column values are automatically available through basic accessors on the Active Record object, but sometimes you