mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
dont merge when you can update (closes #4529) [skaes]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4116 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
d08f838c0e
commit
5fd7118cbc
1 changed files with 2 additions and 2 deletions
|
@ -947,7 +947,7 @@ module ActiveRecord #:nodoc:
|
|||
|
||||
def find_one(id, options)
|
||||
conditions = " AND (#{sanitize_sql(options[:conditions])})" if options[:conditions]
|
||||
options = options.merge :conditions => "#{table_name}.#{primary_key} = #{sanitize(id)}#{conditions}"
|
||||
options.update :conditions => "#{table_name}.#{primary_key} = #{sanitize(id)}#{conditions}"
|
||||
|
||||
if result = find_initial(options)
|
||||
result
|
||||
|
@ -959,7 +959,7 @@ module ActiveRecord #:nodoc:
|
|||
def find_some(ids, options)
|
||||
conditions = " AND (#{sanitize_sql(options[:conditions])})" if options[:conditions]
|
||||
ids_list = ids.map { |id| sanitize(id) }.join(',')
|
||||
options = options.merge :conditions => "#{table_name}.#{primary_key} IN (#{ids_list})#{conditions}"
|
||||
options.update :conditions => "#{table_name}.#{primary_key} IN (#{ids_list})#{conditions}"
|
||||
|
||||
result = find_every(options)
|
||||
|
||||
|
|
Loading…
Reference in a new issue