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

Merge pull request #8823 from acapilleri/target_reflection_has_associated_record

Refactor target_reflection_has_associated_record?
This commit is contained in:
Carlos Antonio da Silva 2013-01-08 14:44:42 -08:00
commit 50241eb2f0

View file

@ -114,11 +114,7 @@ module ActiveRecord
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)