ActiveRecord::ConnectionAdapters::SQLiteAdapter.class_eval do def tables(name = nil) #:nodoc: sql = <<-SQL SELECT name FROM sqlite_master WHERE type = 'table' AND NOT name = 'sqlite_sequence' UNION SELECT name FROM sqlite_temp_master WHERE type = 'table' AND NOT name = 'sqlite_sequence' SQL execute(sql, name).map do |row| row['name'] end end end