plentz / lol_dba

lol_dba is a small package of rake tasks that scan your application models and displays a list of columns that probably should be indexed. Also, it can generate .sql migration scripts.
1.59k stars 69 forks source link

undefined method `options' for nil:NilClass #92

Closed UnConundrum closed 6 years ago

UnConundrum commented 7 years ago

First time use of lol_dba db:find_indexes generated the following error report:

Class: UserQuery
Association type: has_many
Association options: {:class_name=>:bill, :through=>:billings, :foreign_key=>:paid_bill_id, :source=>:bills}
Exception: undefined method `options' for nil:NilClass
/usr/local/var/rben/versions/2.4.0/lib/ruby/gems/2.4.0/gems/lol_dba-2.1.4/lib/lol_dba.rb:133:in `block (2 levels) in check_for_indexes'
/usr/local/var/rben/versions/2.4.0/lib/ruby/gems/2.4.0/gems/lol_dba-2.1.4/lib/lol_dba.rb:97:in `each_pair'
/usr/local/var/rben/versions/2.4.0/lib/ruby/gems/2.4.0/gems/lol_dba-2.1.4/lib/lol_dba.rb:97:in `block in check_for_indexes'
/usr/local/var/rben/versions/2.4.0/lib/ruby/gems/2.4.0/gems/lol_dba-2.1.4/lib/lol_dba.rb:91:in `each'
/usr/local/var/rben/versions/2.4.0/lib/ruby/gems/2.4.0/gems/lol_dba-2.1.4/lib/lol_dba.rb:91:in `check_for_indexes'
/usr/local/var/rben/versions/2.4.0/lib/ruby/gems/2.4.0/gems/lol_dba-2.1.4/lib/lol_dba.rb:186:in `simple_migration'
/usr/local/var/rben/versions/2.4.0/lib/ruby/gems/2.4.0/gems/lol_dba-2.1.4/lib/lol_dba/cli.rb:30:in `start'
/usr/local/var/rben/versions/2.4.0/lib/ruby/gems/2.4.0/gems/lol_dba-2.1.4/lib/lol_dba/cli.rb:18:in `start'
/usr/local/var/rben/versions/2.4.0/lib/ruby/gems/2.4.0/gems/lol_dba-2.1.4/bin/lol_dba:10:in `<top (required)>'
/usr/local/var/rben/versions/2.4.0/bin/lol_dba:22:in `load'
/usr/local/var/rben/versions/2.4.0/bin/lol_dba:22:in `<main>'
plentz commented 6 years ago

can you give 2.1.5 a try?

plentz commented 6 years ago

closing as inactive.