Replaced class_attribute with cattr_accessor for associations