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

Changeset 6091

Show
Ignore:
Timestamp:
01/30/07 03:14:55 (2 years ago)
Author:
minam
Message:

When dealing with SQLite3, use the table_info pragma helper, so that the bindings can do some translation for when sqlite3 breaks incompatibly between point releases. Also, make current_adapter? use is_a? instead of instance_of? to account correctly for adapter subclassing.

Files:

Legend:

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

    r6090 r6091  
    11*SVN* 
     2 
     3* When dealing with SQLite3, use the table_info pragma helper, so that the bindings can do some translation for when sqlite3 breaks incompatibly between point releases. [Jamis Buck] 
    24 
    35* Oracle: fix lob and text default handling.  #7344 [gfriedrich, Michael Schoen] 
  • trunk/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb

    r6012 r6091  
    2323        db.busy_timeout(config[:timeout]) unless config[:timeout].nil? 
    2424 
    25         ConnectionAdapters::SQLiteAdapter.new(db, logger) 
     25        ConnectionAdapters::SQLite3Adapter.new(db, logger) 
    2626      end 
    2727 
     
    382382    end 
    383383 
     384    class SQLite3Adapter < SQLiteAdapter # :nodoc: 
     385      def table_structure(table_name) 
     386        returning structure = @connection.table_info(table_name) do 
     387          raise ActiveRecord::StatementInvalid if structure.empty? 
     388        end 
     389      end 
     390    end 
     391 
    384392    class SQLite2Adapter < SQLiteAdapter # :nodoc: 
    385393      def supports_count_distinct? #:nodoc: 
  • trunk/activerecord/test/abstract_unit.rb

    r4966 r6091  
    5757  types.any? do |type| 
    5858    ActiveRecord::ConnectionAdapters.const_defined?(type) && 
    59       ActiveRecord::Base.connection.instance_of?(ActiveRecord::ConnectionAdapters.const_get(type)) 
     59      ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters.const_get(type)) 
    6060  end 
    6161end