interchange/TableEditor

User - Role

Closed this issue · 3 comments

Connection between users and roles is not visible.

It's a many-to-many connection. Unfortunately DBIx class do not provide a way to get this connection from model (info that it exists), although it can deal with it. I would be happy if someone corrected me, but i spent some time on this...
Solution in written in readme and is as follow:
https://github.com/interchange/TableEditor/blob/master/README.pod

Many to many

"Has many" and "belongs_to" is automatically detected. However, many to many DBIx::Class information doesn't provide enough information, so you have to specify it manually. Only set resultset_attributes once, or it will be overwritten!

    __PACKAGE__->resultset_attributes({ 
            many_to_many => {
                    items => {class => 'TableEdit::Schema::Result::Item', where => {inactive => 'false'}},  
            },              
    });

Actually belongs_to doesn't seem to work, I'll look into this.

Outdated.