Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Now only ARs ancestors are scanned

  • Loading branch information...
commit 1bc8703add1e55247d4110a4bbb50ba8c23a3e91 1 parent da7ab2c
@eladmeidar authored
View
2  lib/indexer.rb
@@ -187,7 +187,7 @@ def self.check_line_for_find_indexes(file_name, line)
end
# Check that all prerequisites are met
- if model_name.present? && table_name.present?
+ if model_name.present? && table_name.present? && model_name.constantize.ancestors.include?(ActiveRecord::Base)
primary_key = model_name.constantize.primary_key
@indexes_required[table_name] += [primary_key] unless @indexes_required[table_name].include?(primary_key)
View
14 test/fixtures/app/controllers/cats_controller.rb
@@ -0,0 +1,14 @@
+class CatsController < ActionController::Base
+
+ before_filter :find_commentable
+
+ def index
+ @cats = nil
+ end
+
+ protected
+
+ def find_commentable
+ #do something awesome
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.