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

Ticket #7727: postgres_async_patch.diff

File postgres_async_patch.diff, 0.9 kB (added by flowdelic, 2 years ago)

Patch to postgresql_adapter.rb

  • vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb

    old new  
    140140 
    141141      def query(sql, name = nil) #:nodoc: 
    142142        log(sql, name) do 
    143           if @async 
     143          if @async && @connection.respond_to?(:async_query) 
    144144            @connection.async_query(sql) 
    145145          else 
    146146            @connection.query(sql) 
     
    150150 
    151151      def execute(sql, name = nil) #:nodoc: 
    152152        log(sql, name) do 
    153           if @async 
     153          if @async && @connection.respond_to?(:async_exec) 
    154154            @connection.async_exec(sql) 
    155155          else 
    156156            @connection.exec(sql)