Skip to content

Instantly share code, notes, and snippets.

@ryanking
ryanking / find id fields without indexes
Created February 22, 2009 20:56
These fields almost always need an index in rails.
select table_name, column_name, column_key from columns where table_schema='YOURDB' and column_name like '%id' and column_key='';
# put this in .irbrc and you can open the files that define constants
def mate mod
file = ActiveSupport::Dependencies.search_for_file(ActiveSupport::Dependencies.qualified_name_for(Kernel, mod).underscore)
`mate #{file}`
nil
end
[ryan@MBP Desktop]$ git clone git://github.com/nex3/haml.git
Initialized empty Git repository in /Users/ryan/Desktop/haml/.git/
remote: error: object directory /data/git/repositories/2/26/64/f0/danbarry/haml.git/objects does not exist; check .git/objects/info/alternates.
remote: error: object directory /data/git/repositories/2/26/64/f0/danbarry/haml.git/objects does not exist; check .git/objects/info/alternates.
remote: error: object directory /data/git/repositories/2/26/64/f0/danbarry/haml.git/objects does not exist; check .git/objects/info/alternates.
remote: error: object directory /data/git/repositories/2/26/64/f0/danbarry/haml.git/objects does not exist; check .git/objects/info/alternates.
remote: error: object directory /data/git/repositories/2/26/64/f0/danbarry/haml.git/objects does not exist; check .git/objects/info/alternates.
remote: error: object directory /data/git/repositories/2/26/64/f0/danbarry/haml.git/objects does not exist; check .git/objects/info/alternates.
remote: error: object di