you are in: codestackercodes [RSS]use default_scope to set up default find conditions such as order

use default_scope to set up default find conditions such as order Delicious Email

show/hide lines
   1  class MyModel < ActiveRecord::Base
   2    default_scope :order => 'created_at desc'
   3  end
created by leozera — 04 October 2009 — get a short url — tags: rails ruby embed

Comments



We dont send spam :)

If checked, it's highlights your comment
simple_captcha.jpg
Are you a human? Type the code from the image