diff options
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/examples/performance.rb | 10 | ||||
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 13 |
2 files changed, 5 insertions, 18 deletions
diff --git a/activerecord/examples/performance.rb b/activerecord/examples/performance.rb index 53acd62f47..f69576b240 100755 --- a/activerecord/examples/performance.rb +++ b/activerecord/examples/performance.rb @@ -1,18 +1,18 @@ #!/usr/bin/env ruby -KU TIMES = (ENV['N'] || 10000).to_i - require 'rubygems' + gem 'addressable', '~>2.0' gem 'faker', '~>0.3.1' gem 'rbench', '~>0.2.3' + require 'addressable/uri' require 'faker' require 'rbench' -__DIR__ = File.dirname(__FILE__) -$:.unshift "#{__DIR__}/../lib" -require 'active_record' +require File.expand_path("../../../load_paths", __FILE__) +require "active_record" conn = { :adapter => 'mysql', :database => 'activerecord_unittest', @@ -55,7 +55,7 @@ class Exhibit < ActiveRecord::Base def self.feel(exhibits) exhibits.each { |e| e.feel } end end -sqlfile = "#{__DIR__}/performance.sql" +sqlfile = File.expand_path("../performance.sql", __FILE__) if File.exists?(sqlfile) mysql_bin = %w[mysql mysql5].select { |bin| `which #{bin}`.length > 0 } diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 7cff6d9f1a..63ab6efae2 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1068,19 +1068,6 @@ module ActiveRecord #:nodoc: attribute_names.all? { |name| column_methods_hash.include?(name.to_sym) } end - def attribute_condition(quoted_column_name, argument) - case argument - when nil then "#{quoted_column_name} IS ?" - when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::NamedScope::Scope then "#{quoted_column_name} IN (?)" - when Range then if argument.exclude_end? - "#{quoted_column_name} >= ? AND #{quoted_column_name} < ?" - else - "#{quoted_column_name} BETWEEN ? AND ?" - end - else "#{quoted_column_name} = ?" - end - end - protected # Scope parameters to method calls within the block. Takes a hash of method_name => parameters hash. # method_name may be <tt>:find</tt> or <tt>:create</tt>. <tt>:find</tt> parameter is <tt>Relation</tt> while |