Permalink
Browse files

Rails 4 has deprecated :order in has_many to use a lambda instead, up…

…date the guide accordingly
  • Loading branch information...
1 parent 7ead1d8 commit b014b4e8cf22f73e155c93b83308805744a13afc @qrush qrush committed May 1, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 guides/source/active_record_querying.md
@@ -732,7 +732,7 @@ The `reorder` method overrides the default scope order. For example:
class Post < ActiveRecord::Base
..
..
- has_many :comments, order: 'posted_at DESC'
+ has_many :comments, -> { order('posted_at DESC') }
end
Post.find(10).comments.reorder('name')

0 comments on commit b014b4e

Please sign in to comment.