Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Check if default is a hash rather than checking if it responds to merge #20840
This fixes scenarios where objects (such as nil) have the 'merge' method defined for other reasons. In this situation, the CanCan gem had defined merge: CanCanCommunity/cancancan#229. It is debatable whether cancan or rails is 'at fault' here, but checking if default is a hash feels more correct based on my understanding of the intended behavior.
If you'd like for a test to be added just let me know.
This fixes #20837