Navigation Menu

Skip to content

dpirotte/acts_as_sortable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

No packages published

Languages