lib/findex/tasks.rb in findex-0.2.2 vs lib/findex/tasks.rb in findex-0.2.3
- old
+ new
@@ -138,10 +138,10 @@
ObjectSpace.each_object(Class) do |model|
next unless model.ancestors.include?(ActiveRecord::Base) && model != ActiveRecord::Base && model.table_exists?
next if @tables && !@tables.include?(model.table_name.to_s)
begin
# Check for views... expected to fail.
- Applicant.connection.execute("SHOW CREATE VIEW #{model.table_name}")
+ ActiveRecord::Base.connection.execute("SHOW CREATE VIEW #{model.table_name}")
rescue ActiveRecord::StatementInvalid
existing_indices = connection.indexes(model.table_name).map{|index| index.columns.length == 1 ? index.columns.first.to_sym : index.columns.map(&:to_sym) }
args.each do |method, options|
indices = send("get_model_#{method}_indices", *[model, options, indices, existing_indices].compact)
end
\ No newline at end of file