eladmeidar / rails_indexes

A rake task to track down missing database indexes. does not assume that all foreign keys end with the convention of _id.
http://blog.eizesus.com/2009/9/find-where-to-index-your-tables-on-a-rails-app/
MIT License
489 stars 35 forks source link

can't exclude tables #9

Open ruckus-matte opened 14 years ago

ruckus-matte commented 14 years ago

I am using the ActiveSalesforce gem to connect one of my models to Salesforce and I'd love to be able to exclude that model from the search. It'd be great to be able to say something like either of the following

rake db:show_me_ar_find_indexes exclude="model1,model2" rake db:show_me_ar_find_indexes only="model1,model2"

What I'm getting now is an exception. A "Mysql::Error: Table 'name' doesn't exist" error to be precise

eladmeidar commented 14 years ago

That's a good idea, but is there any chance you can paste the content of the model in question, i still want to see what caused the exception

ruckus-matte commented 14 years ago

here ya go. the model is a severly cutdown version showing just the connection information. nothing else is really applicable, imho. just validations, custom columns, etc.

http://gist.github.com/259800

eladmeidar commented 14 years ago

oh i see, you are connecting to another db.... and i don't take that into considiration in the plugin. Since there are too many ways to direct a model to use another connection, i assume that your initial suggestion of adding an exclusion parameter maybe the smartest one.

and a better exception handling :)

thanks, expect that change in the next release.