Hello!
A little overview.
I have 1 table (users), and 3 result classes: AbstractUser, User and Admin.
Table has column role (which defines who user is - Admin or User). And I use
inflate_result in AbstractUser result class to "transform" it to Admin or User.
I want to call $schema->resultset('A
Hello!
I've asked this question yesterday on IRC, but didn't get the answer.
The problem.
I have a lot of tables, which have general columns (id, creation date, status,
etc).
Also, some of them have their own columns, another tables have their own
columns (which are different from previous gro
Hmmm.
Seems, that it is because of DBIC::ResultSourceProxy::Table::table().
Looks like columns created, but not copied into result class:
package D;
use base qw/ A B C /;
__PACKAGE__->table('tbl');
D will have only columns from A.
Columns from B and C will not copied into D.
--
//wbr, Dmit
So, I added copying columns into inherited object and it works as I expected.
https://github.com/dim0xff/dbic_inheritance/commit/4ff09513a4e70c3e04226c66ed3a2eabe161ad3b
Now another question: is it good solution, or it could be better? Are there
any disadvantages?
--
//wbr, Dmitry L.
> That's why frew wrote
> https://metacpan.org/pod/DBIx::Class::Helper::Row::SubClass.
>
Yeah, but it works only with one parent. I want to subclass from 2 parent
classes.
--
//wbr, Dmitry Latin
___
List: http://lists.scsys.co.uk/c
st a checker, that defined accessor has type
you want (eg. you have some attribute in your class, and expect that it should
be positivee integer, so some "MooseX::Types::PosInt" already has that checks
and you just use it).
--
//wbr, Dmitry Latin
__
empts to do it (using Moose roles or inheritance via 'extends') was
unsuccessful.
--
//wbr, Dmitry Latin
___
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repo
om
NAC::Model::DBIC::ResultRole::Auditable) will put column into DB::Model (but
not into NAC::Model::DBIC::ResultRole::Auditable).
Thank you again!
PS: Probably it could be usefull to add this info into DBIC::Cookbook.
--
//wbr, Dmitry Latin
___
on prefetches because it shouldn't.
In addition to overriding search_rs, you have to provide conditions into
relations
(https://metacpan.org/pod/DBIx::Class::Relationship::Base#Custom-join-conditions)
--
//wbr, Dmitry Latin
___
List: http://lists.scsys.
On Tuesday 10 of March 2015 17:31:27 Ilya Chesnokov wrote:
> 2015-03-10 12:45 GMT+03:00 Dmitry Latin :
> > Hi!
> >
> >> First I tried to override search_rs() method in a custom resultset
> >> with something like this:
> >> https://gist.github.com/iche
10 matches
Mail list logo