mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
More eager fixes
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -65,9 +65,7 @@ module ActiveRecord
|
||||
load_target.select { |record| ids.include?(record.id) }
|
||||
end
|
||||
else
|
||||
original_conditions = options[:conditions] ? " AND #{options[:conditions]}" : ""
|
||||
options[:conditions] =
|
||||
"#{@association_class_primary_key_name} = #{@owner.quoted_id} #{@conditions ? " AND " + @conditions : ""}#{original_conditions}"
|
||||
options[:conditions] = @finder_sql + (options[:conditions] ? " AND #{options[:conditions]}" : "")
|
||||
@association_class.find(args.size == 1 ? args.first : args, options)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -34,7 +34,7 @@ module ActiveRecord
|
||||
# Project.find_all ["category = ?", category_name], "created ASC", [15, 20]
|
||||
def find_all(conditions = nil, orderings = nil, limit = nil, joins = nil)
|
||||
limit, offset = limit.is_a?(Array) ? limit : [ limit, nil ]
|
||||
find(:all, { :conditions => conditions, :order => orderings, :joins => joins, :limit => limit, :offset => offset})
|
||||
find(:all, :conditions => conditions, :order => orderings, :joins => joins, :limit => limit, :offset => offset)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user