support anonymous classes on has_many associations