composite-primary-keys / composite_primary_keys

Composite Primary Keys support for Active Record
1.03k stars 350 forks source link

AttributeMethods has_attribute? override conflicts with other gems #526

Closed ndguarino closed 4 years ago

ndguarino commented 4 years ago

Problem: composite_primary_keys's override of ActiveRecord::AttributeMethods.has_attribute? uses AttributeMethods.attributes instead of @attributes as the original method it overrides does. This conflicts with gems which override AttributeMethods.attributes, creating a situation which will cause a SystemStackError.

Fix: In the gem's override of has_attribute?, convert the attributes call to a direct access to @attributes.

ndguarino commented 4 years ago

Fix implemented in PR #527