Skip to content
This repository
Browse code

change activerecord query conditions example to avoid 'type' as colum…

…n name

'Type' is a reserved column for STI.  Changed conditions example to
avoid using that column name as an example.  The example isn't
STI-related (and mentioning STI here is needless clutter), so changing
to avoid accidentally encouraging users to use 'type' as a column name
for other purposes.
  • Loading branch information...
commit 840246c157b894abf2470833c3bd261e3e0248b5 1 parent a27f6ec
Steve Bourne authored vijaydev committed

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 activerecord/lib/active_record/base.rb
4 activerecord/lib/active_record/base.rb
@@ -116,8 +116,8 @@ module ActiveRecord #:nodoc:
116 116 # When joining tables, nested hashes or keys written in the form 'table_name.column_name'
117 117 # can be used to qualify the table name of a particular condition. For instance:
118 118 #
119   - # Student.joins(:schools).where(:schools => { :type => 'public' })
120   - # Student.joins(:schools).where('schools.type' => 'public' )
  119 + # Student.joins(:schools).where(:schools => { :category => 'public' })
  120 + # Student.joins(:schools).where('schools.category' => 'public' )
121 121 #
122 122 # == Overwriting default accessors
123 123 #

0 comments on commit 840246c

Please sign in to comment.
Something went wrong with that request. Please try again.