Permalink
Browse files

target_reflection_has_associated_record? refactoring

  • Loading branch information...
1 parent e5d4367 commit 77715951144a03ab5274f2267844da24775a5d13 @acapilleri acapilleri committed Jan 8, 2013
Showing with 1 addition and 5 deletions.
  1. +1 −5 activerecord/lib/active_record/associations/has_many_through_association.rb
@@ -114,11 +114,7 @@ def build_record(attributes)
end
def target_reflection_has_associated_record?
- if through_reflection.macro == :belongs_to && owner[through_reflection.foreign_key].blank?
- false
- else
- true
- end
+ !(through_reflection.macro == :belongs_to && owner[through_reflection.foreign_key].blank?)
end
def update_through_counter?(method)

0 comments on commit 7771595

Please sign in to comment.