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

Fix NoMethodError: undefined method `group_by' for "db/migrate":String #88

Closed tapajos closed 7 years ago

tapajos commented 7 years ago

Problem:

::ActiveRecord::VERSION::MAJOR returns only the major version number but seems like the code is expecting the full string.

(LolDba::SqlGenerator) > ::ActiveRecord::VERSION::MAJOR
=> 4
(LolDba::SqlGenerator) > ::ActiveRecord::VERSION::MAJOR =~ /^4./
=> nil

I've printed ::ActiveRecord::VERSION::MAJOR for all versions in Appraisals:

"3.2.22.5" => 3
"4.0.13" => 4
"4.1.16" => 4
"4.2.8" => 4
plentz commented 7 years ago

thanks! ❤️