Renamed helpers to correspond to renamed Controller classes.
[merb_radiant.git] / radiant_extensions_plugins / plugins / default_order / .svn / text-base / README.svn-base
blobe533d3d759b9ffaf46c9ae4cb76f359a590b4ca2
1 DefaultOrder
2 ============
4 Author : Antonin AMAND
5 Email : aamand@gwikzone.org
7 The default_order plugin provides a 'order_by' method to
8 be called in your models.
10 ex : 
12 class Contact < ActiveRecord::Base
13   order_by "first_name, last_name"
15 end
17 the order_by method will append the given argument to 
18 :order Hash key of ActiveRecord::Base.find method
19 IF IT HAS NOT BEEN PROVIDED.
21 ex : 
23 Contact.find(:all, :conditions => "last_name LIKE '%toto%'")
24 # will act as if you had written this
25 Contact.find(:all, :order => "last_name, first_name",
26         :conditions => "last_name LIKE '%toto%'")
27 # but if you provide :order it will override the default order
29 If you use those attributes in other models, you
30 may want to specify the table_name :
32 class Contact < ActiveRecord::Base
33   order_by "contacts.first_name, contacts.last_name"
35 end