Skip to content

Commit

Permalink
fixes generation of the AR querying guide
Browse files Browse the repository at this point in the history
  • Loading branch information
fxn committed Aug 17, 2011
1 parent 633a569 commit 2e45cfe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions railties/guides/source/active_record_querying.textile
Expand Up @@ -560,6 +560,7 @@ Client.where("orders_count > 10").order(:name).reverse_order
</ruby> </ruby>


The SQL that would be executed: The SQL that would be executed:

<sql> <sql>
SELECT * FROM clients WHERE orders_count > 10 ORDER BY name DESC SELECT * FROM clients WHERE orders_count > 10 ORDER BY name DESC
</sql> </sql>
Expand All @@ -571,6 +572,7 @@ Client.where("orders_count > 10").reverse_order
</ruby> </ruby>


The SQL that would be executed: The SQL that would be executed:

<sql> <sql>
SELECT * FROM clients WHERE orders_count > 10 ORDER BY clients.id DESC SELECT * FROM clients WHERE orders_count > 10 ORDER BY clients.id DESC
</sql> </sql>
Expand Down Expand Up @@ -621,8 +623,6 @@ You're then responsible for dealing with the conflict by rescuing the exception


NOTE: You must ensure that your database schema defaults the +lock_version+ column to +0+. NOTE: You must ensure that your database schema defaults the +lock_version+ column to +0+.


<br />

This behavior can be turned off by setting <tt>ActiveRecord::Base.lock_optimistically = false</tt>. This behavior can be turned off by setting <tt>ActiveRecord::Base.lock_optimistically = false</tt>.


To override the name of the +lock_version+ column, +ActiveRecord::Base+ provides a class method called +set_locking_column+: To override the name of the +lock_version+ column, +ActiveRecord::Base+ provides a class method called +set_locking_column+:
Expand Down

0 comments on commit 2e45cfe

Please sign in to comment.