Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Change DBIx::Class accessor in schema loader for Moose role hookby gryphon (Abbot) |
on Sep 11, 2013 at 21:43 UTC ( [id://1053571]=perlquestion: print w/replies, xml ) | Need Help?? |
gryphon has asked for the wisdom of the Perl Monks concerning the following question: Greetings all,
I have a DBIx::Class schema loader + Moose role + accessor problem/question. I've got DBIx::Class schema loader building a schema, and from this there's a generated class, specifically *::Result::User for the "user" table. In that table, there's a "passwd" column that I'd like to encrypt/decrypt magically in DBIC appropriately on read/write. In the schema loader configuration, I'm asking for a specific Moose role to get added to the *::Result::User class. Ultimately, I'd like to tell DBIC that the "passwd" column should have a "_passwd" accessor, then write a "sub passwd" in the role. To get to this, I added a "custom_column_info" key to my schema loader configuration. If I want to add any keys to the column definitions, this works perfectly as expected. However, for some reason, any "accessor" keys are silently filtered and never end up in the generated schema classes. Here's the schema loader code:
What am I doing wrong here? Thanks.
Back to
Seekers of Perl Wisdom
|
|