One of controllers in my projeect had private a method named "find_attr_by_name". I runned the db:db:find_query_indexes query, it looks like it searchs for "find_xxxx" in all classes and when it found a class with this method it calls the "table_name" attribute from the class. Most of the cases it will be in a model class, but in this case it is a controller class, so the task fails.
One of controllers in my projeect had private a method named "find_attr_by_name". I runned the db:db:find_query_indexes query, it looks like it searchs for "find_xxxx" in all classes and when it found a class with this method it calls the "table_name" attribute from the class. Most of the cases it will be in a model class, but in this case it is a controller class, so the task fails.
Here is the backtrace:
undefined method
table_name' for ExportacoesPdvController:Class /Users/razenha/Projects/Pro/portaltrademarketingpoptrade/vendor/plugins/rails_indexes/tasks/../lib/indexer.rb:180:in
check_line_for_find_indexes' /Users/razenha/Projects/Pro/portaltrademarketingpoptrade/vendor/plugins/rails_indexes/tasks/../lib/indexer.rb:134:inscan_finds' /Users/razenha/Projects/Pro/portaltrademarketingpoptrade/vendor/plugins/rails_indexes/tasks/../lib/indexer.rb:112:in
each' /Users/razenha/Projects/Pro/portaltrademarketingpoptrade/vendor/plugins/rails_indexes/tasks/../lib/indexer.rb:112:inscan_finds' /Users/razenha/Projects/Pro/portaltrademarketingpoptrade/vendor/plugins/rails_indexes/tasks/../lib/indexer.rb:108:in
each' /Users/razenha/Projects/Pro/portaltrademarketingpoptrade/vendor/plugins/rails_indexes/tasks/../lib/indexer.rb:108:inscan_finds' /Users/razenha/Projects/Pro/portaltrademarketingpoptrade/vendor/plugins/rails_indexes/tasks/../lib/indexer.rb:279:in
ar_find_indexes' /Users/razenha/Projects/Pro/portaltrademarketingpoptrade/vendor/plugins/rails_indexes/tasks/indexer.rake:6 /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/lib/rake.rb:636:incall' /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/lib/rake.rb:636:in
execute' /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/lib/rake.rb:631:ineach' /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/lib/rake.rb:631:in
execute' /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/lib/rake.rb:597:ininvoke_with_call_chain' /Users/razenha/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/monitor.rb:242:in
synchronize' /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/lib/rake.rb:590:ininvoke_with_call_chain' /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/lib/rake.rb:583:in
invoke' /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/lib/rake.rb:2051:ininvoke_task' /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/lib/rake.rb:2029:in
top_level' /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/lib/rake.rb:2029:ineach' /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/lib/rake.rb:2029:in
top_level' /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/lib/rake.rb:2068:instandard_exception_handling' /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/lib/rake.rb:2023:in
top_level' /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/lib/rake.rb:2001:inrun' /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/lib/rake.rb:2068:in
standard_exception_handling' /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/lib/rake.rb:1998:inrun' /Users/razenha/.rvm/gems/ruby-1.8.7-p299/gems/rake-0.8.7/bin/rake:31 /Users/razenha/.rvm/gems/ruby-1.8.7-p299/bin/rake:19:in
load'/Users/razenha/.rvm/gems/ruby-1.8.7-p299/bin/rake:19