I probably miss something but shouldn't every model has access to DB inside 
it's code with no explicit "pg => shift->pg" argument? Do you suggest 
passing pg handler to every model as an additional parameter? Doesn't it 
look weird? I'm asking because I have the same issue with application 
structure now (relatively new to Mojo). It seems to me there must DB 
package which one can use where they need and find dbh singleton there. 
Looking forward to your thoughts on it.

Cheers
Eugene

On Friday, March 13, 2015 at 4:15:44 AM UTC+3, sri wrote:
>
> This seems to have become kind of an FAQ. What is the right way to 
> integrate Mojo::Pg into full Mojolicious applications? And how do we 
> separate concerns properly? When i recently mentioned on IRC that Minion is 
> actually a good example, that caused some confusion, since many folks don't 
> see it as a Model.
>
> So i've tried to make a much more generic example. It is super 
> minimalistic, and its only purpose will be to illustrate what i think a 
> clean Mojolicious application should look like.
>
>     
> https://github.com/kraih/mojo-pg/commit/45e9d9134e7e7a243099c95ab8bec1b5308fde81
>
> Please let me know if anything is still not clear enough.
>
> --
> sebastian
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to