Sort lists of ActiveRecord objects. Simply.
License
dpirotte/acts_as_sortable
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ActsAsSortable ============== This is a simple plugin to create default sorting orders for arrays of ActiveRecord objects. This plugin is pretty stupid, given the existence of sort_by, but I'd never written a plugin before and felt like giving it a go. Example ======= class Thing < ActiveRecord::Base acts_as_sortable :name, :created_at end # Now you get... Thing.all.sort == Thing.all.sort_by { |t| [t.name, t.created_at] } Copyright (c) 2008 Dave Pirotte, released under the MIT license
About
Sort lists of ActiveRecord objects. Simply.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published