Skip to content

Instantly share code, notes, and snippets.

@madhums
Created November 12, 2010 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madhums/673890 to your computer and use it in GitHub Desktop.
Save madhums/673890 to your computer and use it in GitHub Desktop.
mini-find - this will save a few key strokes!
class << ActiveRecord::Base
alias_method :[], :find
end
@post = Post[5]
@post = Post[:first]
@post = Post[:all, :conditions => { :name => "first post" }]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment