Skip to content

Commit 4621f71

Browse files
committed
KISS ActiveRecord::Associations::Deprecation.user_facing_reflection
Another one pursuing a nice spot for HABTMs and deprecation. Do not feel quite confortable hard-coding this logic here, let's keep it simple.
1 parent 78d6ff6 commit 4621f71

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

activerecord/lib/active_record/associations/deprecation.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,7 @@ def set_backtrace_supports_array_of_locations?
7979
end
8080

8181
def user_facing_reflection(reflection)
82-
case reflection.parent_reflection
83-
when ActiveRecord::Reflection::HasAndBelongsToManyReflection
84-
reflection.parent_reflection
85-
else
86-
reflection
87-
end
82+
reflection.active_record.reflect_on_association(reflection.name)
8883
end
8984
end
9085

0 commit comments

Comments
 (0)