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:
commit
50241eb2f0
1 changed files with 1 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue