aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-03-27 06:57:53 +0000
committerRick Olson <technoweenie@gmail.com>2007-03-27 06:57:53 +0000
commit4b78a2a245cb69e958e3d62d4c0e6fcab2eb3e76 (patch)
tree19e471f5d0192458e06d457b100e76fa602c0dc9 /activerecord/lib/active_record/connection_adapters
parent777deb9d15791e137b200e96283ff03b075fd3dc (diff)
downloadrails-4b78a2a245cb69e958e3d62d4c0e6fcab2eb3e76.tar.gz
rails-4b78a2a245cb69e958e3d62d4c0e6fcab2eb3e76.tar.bz2
rails-4b78a2a245cb69e958e3d62d4c0e6fcab2eb3e76.zip
Add helpful debugging info to the ActiveRecord::StatementInvalid exception in ActiveRecord::ConnectionAdapters::SqliteAdapter#table_structure. Closes #7925. [court3nay]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6469 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r--activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
index 2c4e63b87d..6409fe292a 100644
--- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -286,7 +286,7 @@ module ActiveRecord
protected
def table_structure(table_name)
returning structure = execute("PRAGMA table_info(#{table_name})") do
- raise ActiveRecord::StatementInvalid if structure.empty?
+ raise(ActiveRecord::StatementInvalid, "Could not find table '#{table_name}'") if structure.empty?
end
end
@@ -384,7 +384,7 @@ module ActiveRecord
class SQLite3Adapter < SQLiteAdapter # :nodoc:
def table_structure(table_name)
returning structure = @connection.table_info(table_name) do
- raise ActiveRecord::StatementInvalid if structure.empty?
+ raise(ActiveRecord::StatementInvalid, "Could not find table '#{table_name}'") if structure.empty?
end
end
end