1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Nested attributes and in-memory changed values #first and #[] behaviour consistency fix

This commit is contained in:
Alexey Nayden 2011-01-13 00:24:12 +03:00 committed by Aaron Patterson
parent 2884482c34
commit e92c2ffd8e

View file

@ -518,7 +518,7 @@ module ActiveRecord
def fetch_first_or_last_using_find?(args)
(args.first.kind_of?(Hash) && !args.first.empty?) || !(loaded? || @owner.new_record? || @reflection.options[:finder_sql] ||
@target.any? { |record| record.new_record? } || args.first.kind_of?(Integer))
@target.any? { |record| record.new_record? || record.changed? } || args.first.kind_of?(Integer))
end
def include_in_memory?(record)