diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-03 18:21:20 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-03 18:21:20 +0000 |
commit | edcaa2e5f76263ba7d0179c5d5d2de9d45932c93 (patch) | |
tree | 1585f8806f17fc9878ab803b37ff01d6af34a706 /activerecord/lib/active_record | |
parent | f8783abf0cd409d53e7e104b576d45966252378b (diff) | |
download | rails-edcaa2e5f76263ba7d0179c5d5d2de9d45932c93.tar.gz rails-edcaa2e5f76263ba7d0179c5d5d2de9d45932c93.tar.bz2 rails-edcaa2e5f76263ba7d0179c5d5d2de9d45932c93.zip |
More eager fixes
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations/has_many_association.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/deprecated_finders.rb | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_association.rb b/activerecord/lib/active_record/associations/has_many_association.rb index f6bceee93a..272a1fe567 100644 --- a/activerecord/lib/active_record/associations/has_many_association.rb +++ b/activerecord/lib/active_record/associations/has_many_association.rb @@ -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 diff --git a/activerecord/lib/active_record/deprecated_finders.rb b/activerecord/lib/active_record/deprecated_finders.rb index cdbba37085..adc73e0d5d 100644 --- a/activerecord/lib/active_record/deprecated_finders.rb +++ b/activerecord/lib/active_record/deprecated_finders.rb @@ -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 |