2021-12-04 02:26:25 -05:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
package GuestbookNg::Model::Test;
|
|
|
|
|
2021-12-04 18:36:10 -05:00
|
|
|
use Mojo::Base -base, -signatures;
|
2021-12-04 02:26:25 -05:00
|
|
|
|
2021-12-04 18:36:10 -05:00
|
|
|
has 'pg';
|
|
|
|
|
|
|
|
sub new($class, $pg, $object) {
|
2021-12-04 18:50:19 -05:00
|
|
|
bless {$pg => $object}
|
2021-12-04 02:26:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
sub test_model($self, $string) {
|
|
|
|
"you've supplied: $string"
|
|
|
|
}
|
|
|
|
|
2021-12-04 18:36:10 -05:00
|
|
|
sub create_table($self) {
|
2021-12-04 22:33:53 -05:00
|
|
|
$self->pg->migrations->from_dir('migrations')->migrate(1);
|
2021-12-04 18:36:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
sub now($self) {
|
|
|
|
$self->pg->db->query('SELECT NOW() AS now')->text()
|
|
|
|
}
|
|
|
|
|
2021-12-04 02:26:25 -05:00
|
|
|
1;
|