RSS Git Download  Clone
Raw Blame History
package AppTest;

use strict;
use warnings;

use FindBin qw($Bin); # warn $Bin;
use Data::Printer;
use YAML::Tiny;
use Model;
use Moo;

$ENV{SQL_TRACE} = 0;

has model => (
    is => 'ro',
    builder => sub { Model->new( app_config => shift->config ) },
);
has config => ( is => 'lazy' );

sub _build_config {
    my $yml = YAML::Tiny->read($Bin . '/../config.yml') || die $!; # p $yml->[0];
    my $cfg = $yml->[0];
    $cfg->{appdir} = $Bin . '/..'; # need to add manually, done in app by D2
=begin
    my $cfg = { # required params from config.yml:
        db_name => 'outreach_patient_access',
        appdir  => $Bin . '/..',
    }; # p $cfg;
=cut
    return $cfg;
}

1;