jackdempsey / sequel_polymorphic

MIT License
37 stars 13 forks source link

Cannot associate with camel-cased class name #11

Closed graft closed 9 years ago

graft commented 9 years ago

The latest commit (e35f52844295c315ade7f40620697da474b6e24c) breaks my associations (although it fixed my issue with 'constantize', which is good); I have a column type that is camel-cased (i.e., clinical_type: "ClinicalColorectal"). Calling capitalize on this value results in incorrect behavior, and the association fails because it cannot find a class named "Clinicalcolorectal". I'm not sure why it should be necessary to transform able_type when loading - surely this column should be written with the exact class name?

kuraga commented 9 years ago

Our fault. There had been capitalize in another place when I came a collaborator. Should be camelcase instead in that place and others.

Fixed in https://github.com/jackdempsey/sequel_polymorphic/commit/9c400a10afcf6468694e5439822dd8cd9934b72b.

@graft, @Draiken, @nazipov, can you check if your code work using master branch, please?

nazipov commented 9 years ago

@kuraga Yes, it works!

graft commented 9 years ago

@kuraga works for me, thanks for the quick update!

kuraga commented 9 years ago

Released v0.2.2.