Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

push !loaded? conditional up

  • Loading branch information...
commit 0aef847927ed2f9c3e3dca92207d9a62baa01b1a 1 parent b8ed2d5
@tenderlove tenderlove authored
View
18 activerecord/lib/active_record/associations/association_collection.rb
@@ -349,18 +349,16 @@ def uniq_select_value
end
def load_target
- if !@owner.new_record? || foreign_key_present?
- unless loaded?
- targets = []
-
- begin
- targets = find_target
- rescue ActiveRecord::RecordNotFound
- reset
- end
+ if (!@owner.new_record? || foreign_key_present?) && !loaded?
+ targets = []
- @target = merge_target_lists(targets, @target)
+ begin
+ targets = find_target
+ rescue ActiveRecord::RecordNotFound
+ reset
end
+
+ @target = merge_target_lists(targets, @target)
end
loaded
Please sign in to comment.
Something went wrong with that request. Please try again.