MT#5879 Add sent marker into invoices and country_name into contacts.

Country_name as a method to wrap country code into full name.
agranig/pbx-dev-map
Irina Peshinskaya 11 years ago
parent 20887f5dba
commit f5fca0819c

@ -1,6 +1,7 @@
package NGCP::Schema::Result::contacts;
use Scalar::Util qw(blessed);
use parent 'DBIx::Class::Core';
use Geography::Countries ();#exported by default too
our $VERSION = '2.007';
@ -148,6 +149,11 @@ __PACKAGE__->has_many(
{ cascade_copy => 0, cascade_delete => 0 },
);
sub country_name{
my ($self) = @_;
return scalar Geography::Countries::country( $self->country );
}
sub TO_JSON {
my ($self) = @_;
return {

@ -45,6 +45,9 @@ __PACKAGE__->add_columns(
{ data_type => "double precision", default_value => 0, is_nullable => 0 },
"data",
{ data_type => "blob", is_nullable => 1 },
"sent_date",
{ data_type => "datetime", is_nullable => 1, datetime_undef_if_invalid => 1, },
);
__PACKAGE__->set_primary_key("id");

Loading…
Cancel
Save