[Dbix-class] Inherited search method, current_source_alias and add_to_ for many_to_many.

2013-04-04 Thread Dmitry Latin
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

[Dbix-class] Reusing defined columns (inheritance?)

2013-12-27 Thread Dmitry Latin
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

[Dbix-class] Re: Reusing defined columns (inheritance?)

2013-12-27 Thread Dmitry Latin
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

[Dbix-class] Re: Reusing defined columns (inheritance?)

2013-12-27 Thread Dmitry Latin
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.

Re: [Dbix-class] Re: Reusing defined columns (inheritance?)

2013-12-30 Thread Dmitry Latin
> 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

Re: [Dbix-class] Re: Reusing defined columns (inheritance?)

2013-12-30 Thread Dmitry Latin
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 __

Re: [Dbix-class] Re: Reusing defined columns (inheritance?)

2014-01-03 Thread 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

Re: [Dbix-class] Re: Reusing defined columns (inheritance?)

2014-01-04 Thread Dmitry Latin
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 ___

Re: [Dbix-class] "Deletion" of records by setting status to 'deleted'

2015-03-10 Thread 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.

Re: [Dbix-class] "Deletion" of records by setting status to 'deleted'

2015-03-10 Thread Dmitry Latin
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