aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result/Nearby.pm
blob: d3d22878801be05ebfe51ae406b5a18bfe1ee6ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package FixMyStreet::DB::Result::Nearby;

# Thanks to http://www.perlmonks.org/?node_id=633800

use strict;
use warnings;

use base 'DBIx::Class::Core';
use Moose;
use namespace::clean -except => [ 'meta' ];

__PACKAGE__->table( 'NONE' );
__PACKAGE__->add_columns(
  "problem_id",
  { data_type => "integer", is_nullable => 0 },
  "distance",
  { data_type => "double precision", is_nullable => 0 },
);
__PACKAGE__->belongs_to(
  "problem",
  "FixMyStreet::DB::Result::Problem",
  { id => "problem_id" },
  { is_deferrable => 1 },
);

# Make a new ResultSource based on the User class
__PACKAGE__->result_source_instance
    ->name( \'problem_find_nearby(?,?,?)' );

# we need the inline_constructor bit as we don't inherit from Moose
__PACKAGE__->meta->make_immutable( inline_constructor => 0 );

1;