Skip to content

Commit

Permalink
loaded? will not raise an AR::RecordNotFound exception, so move the r…
Browse files Browse the repository at this point in the history
…escue inside the conditional
  • Loading branch information
tenderlove committed Jan 14, 2011
1 parent c326969 commit a0a69b0
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -350,8 +350,8 @@ def uniq_select_value

def load_target
if !@owner.new_record? || foreign_key_present?
begin
unless loaded?
unless loaded?
begin
if @target.is_a?(Array) && @target.any?
@target = find_target.map do |f|
i = @target.index(f)
Expand All @@ -371,9 +371,9 @@ def load_target
else
@target = find_target
end
rescue ActiveRecord::RecordNotFound
reset
end
rescue ActiveRecord::RecordNotFound
reset
end
end

Expand Down

0 comments on commit a0a69b0

Please sign in to comment.