This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Return 0 if there is data to be read */ | |
| my_bool vio_poll_read(Vio *vio,uint timeout) | |
| { | |
| #ifndef HAVE_POLL | |
| return 0; | |
| #else | |
| struct pollfd fds; | |
| int res; | |
| DBUG_ENTER("vio_poll"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ActiveRecord::ConnectionAdapters::MysqlAdapter.class_eval do | |
| def execute(sql, name = nil) #:nodoc: | |
| if @connection.respond_to?(:async_query) | |
| log(sql, "Async #{name || ''}") { @connection.async_query(sql) } | |
| else | |
| log(sql, name) { @connection.query(sql) } | |
| end | |
| rescue ActiveRecord::StatementInvalid => exception | |
| if exception.message.split(":").first =~ /Packets out of order/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ApplicationController < AC::Base | |
| def with_etags( *etag, &block ) | |
| etag = supplement_etag!( etag ).compact | |
| logger.info "** Etag source: #{etag.inspect}" | |
| response.last_modified = last_modified_for_etag( etag ).sort.last || now | |
| logger.info "** Response Last Modified: #{response.last_modified}" | |
| response.etag = etag | |
| logger.info "** Response Etag: #{response.etag.inspect}" | |
| if request.fresh?(response) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| unless Object.const_defined? 'WillPaginate' | |
| module ActiveRecord | |
| class Base | |
| class << self | |
| def paginate( options = {} ) | |
| find( :all, options.except( :page, :per_page ) ) | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >> pounds = 1.5 | |
| => 1.5 | |
| >> ounces = (1 - "0.#{pounds.to_s.split('.').last}".to_f) * 16 | |
| => 8.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Accountable | |
| class Transaction < ::ActiveRecord::Base # to ensure not clashing with Accountable::ActiveRecord::Macro | |
| has_many :credits | |
| has_many :debits | |
| end | |
| end | |
| module Accountable | |
| module Accounts | |
| class Base < ::ActiveRecord::Base #see above |
NewerOlder