Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 6469

Show
Ignore:
Timestamp:
03/27/07 06:57:53 (2 years ago)
Author:
rick
Message:

Add helpful debugging info to the ActiveRecord::StatementInvalid exception in ActiveRecord::ConnectionAdapters::SqliteAdapter#table_structure. Closes #7925. [court3nay]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/CHANGELOG

    r6449 r6469  
    11*SVN* 
     2 
     3* Add helpful debugging info to the ActiveRecord::StatementInvalid exception in ActiveRecord::ConnectionAdapters::SqliteAdapter#table_structure.  Closes #7925. [court3nay] 
    24 
    35* SQLite: binary escaping works with $KCODE='u'.  #7862 [tsuka] 
  • trunk/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb

    r6449 r6469  
    287287        def table_structure(table_name) 
    288288          returning structure = execute("PRAGMA table_info(#{table_name})") do 
    289             raise ActiveRecord::StatementInvalid if structure.empty? 
     289            raise(ActiveRecord::StatementInvalid, "Could not find table '#{table_name}'") if structure.empty? 
    290290          end 
    291291        end 
     
    385385      def table_structure(table_name) 
    386386        returning structure = @connection.table_info(table_name) do 
    387           raise ActiveRecord::StatementInvalid if structure.empty? 
     387          raise(ActiveRecord::StatementInvalid, "Could not find table '#{table_name}'") if structure.empty? 
    388388        end 
    389389      end