1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add documentation for qualifying table names in conditions hashes

This commit is contained in:
Joel Chippindale 2009-06-18 06:13:39 +01:00
parent d2dfd340e3
commit f9c6dcbf7c

View file

@ -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