Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Nested attributes and in-memory changed values #first and #[] behavio…

…ur consistency fix
  • Loading branch information...
commit e92c2ffd8eebf4b0b1f260cfe77c0d9690ba8fef 1 parent 2884482
@anayden anayden authored tenderlove committed
View
2  activerecord/lib/active_record/associations/association_collection.rb
@@ -518,7 +518,7 @@ def ensure_owner_is_persisted!
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)
Please sign in to comment.
Something went wrong with that request. Please try again.