Remove all traces remaining traces of old method names
This commit is contained in:
parent
5a9ab37254
commit
7671180e1b
|
@ -115,7 +115,7 @@ group {
|
||||||
$c->stash(status => 400)
|
$c->stash(status => 400)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$c->remark->create_remark(
|
$c->remark->create(
|
||||||
$thread_id,
|
$thread_id,
|
||||||
$remark_name,
|
$remark_name,
|
||||||
$remark_body
|
$remark_body
|
||||||
|
|
|
@ -33,14 +33,10 @@ sub by_page_for($self, $thread_id, $this_page = 1) {
|
||||||
END_SQL
|
END_SQL
|
||||||
}
|
}
|
||||||
|
|
||||||
*get_remarks_by_thread_id = \&by_page_for;
|
|
||||||
|
|
||||||
sub per_page($self, $value = undef) {
|
sub per_page($self, $value = undef) {
|
||||||
$self->{'remarks_per_page'} = $value // $self->{'remarks_per_page'}
|
$self->{'remarks_per_page'} = $value // $self->{'remarks_per_page'}
|
||||||
}
|
}
|
||||||
|
|
||||||
*remarks_per_page = \&per_page;
|
|
||||||
|
|
||||||
sub create($self, $thread_id, $author, $body, $hidden = 0, $flagged = 0) {
|
sub create($self, $thread_id, $author, $body, $hidden = 0, $flagged = 0) {
|
||||||
my @data = ($thread_id, $author, $body, $hidden, $flagged);
|
my @data = ($thread_id, $author, $body, $hidden, $flagged);
|
||||||
|
|
||||||
|
@ -56,8 +52,6 @@ sub create($self, $thread_id, $author, $body, $hidden = 0, $flagged = 0) {
|
||||||
END_SQL
|
END_SQL
|
||||||
}
|
}
|
||||||
|
|
||||||
*create_remark = \&create;
|
|
||||||
|
|
||||||
sub count_for($self, $thread_id) {
|
sub count_for($self, $thread_id) {
|
||||||
$self->pg->db->query(<<~'END_SQL', $thread_id)->hash->{'count'}
|
$self->pg->db->query(<<~'END_SQL', $thread_id)->hash->{'count'}
|
||||||
SELECT COUNT(*) AS count
|
SELECT COUNT(*) AS count
|
||||||
|
@ -67,8 +61,6 @@ sub count_for($self, $thread_id) {
|
||||||
END_SQL
|
END_SQL
|
||||||
}
|
}
|
||||||
|
|
||||||
*get_remark_count_by_thread_id = \&count_for;
|
|
||||||
|
|
||||||
sub last_page_for($self, $thread_id) {
|
sub last_page_for($self, $thread_id) {
|
||||||
my $remark_count = $self->count_for($thread_id);
|
my $remark_count = $self->count_for($thread_id);
|
||||||
my $last_page = int($remark_count / $self->{'remarks_per_page'});
|
my $last_page = int($remark_count / $self->{'remarks_per_page'});
|
||||||
|
@ -79,8 +71,6 @@ sub last_page_for($self, $thread_id) {
|
||||||
$last_page;
|
$last_page;
|
||||||
}
|
}
|
||||||
|
|
||||||
*get_last_page_by_thread_id = \&last_page_for;
|
|
||||||
|
|
||||||
sub last_for($self, $thread_id) {
|
sub last_for($self, $thread_id) {
|
||||||
my $date_format = $self->{'date_format'};
|
my $date_format = $self->{'date_format'};
|
||||||
|
|
||||||
|
@ -96,6 +86,4 @@ sub last_for($self, $thread_id) {
|
||||||
END_SQL
|
END_SQL
|
||||||
}
|
}
|
||||||
|
|
||||||
*last_remark = \&last_for;
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
@ -29,8 +29,6 @@ sub create($self, $author, $title, $body, $hidden = 0, $flagged = 0) {
|
||||||
END_SQL
|
END_SQL
|
||||||
}
|
}
|
||||||
|
|
||||||
*create_thread = \&create;
|
|
||||||
|
|
||||||
sub dump_all($self) {
|
sub dump_all($self) {
|
||||||
$self->pg->db->query(<<~'END_SQL', %$self{'date_format'})->hashes
|
$self->pg->db->query(<<~'END_SQL', %$self{'date_format'})->hashes
|
||||||
SELECT thread_id AS id,
|
SELECT thread_id AS id,
|
||||||
|
@ -44,8 +42,6 @@ sub dump_all($self) {
|
||||||
END_SQL
|
END_SQL
|
||||||
}
|
}
|
||||||
|
|
||||||
*get_all_threads = \&dump_all;
|
|
||||||
|
|
||||||
sub by_page($self, $this_page = 1) {
|
sub by_page($self, $this_page = 1) {
|
||||||
my $date_format = %$self{'date_format'};
|
my $date_format = %$self{'date_format'};
|
||||||
my $row_count = $self->{'threads_per_page'};
|
my $row_count = $self->{'threads_per_page'};
|
||||||
|
@ -65,14 +61,10 @@ sub by_page($self, $this_page = 1) {
|
||||||
END_SQL
|
END_SQL
|
||||||
}
|
}
|
||||||
|
|
||||||
*get_threads_by_page = \&by_page;
|
|
||||||
|
|
||||||
sub per_page($self, $value = undef) {
|
sub per_page($self, $value = undef) {
|
||||||
$self->{'threads_per_page'} = $value // $self->{'threads_per_page'}
|
$self->{'threads_per_page'} = $value // $self->{'threads_per_page'}
|
||||||
}
|
}
|
||||||
|
|
||||||
*threads_per_page = \&per_page;
|
|
||||||
|
|
||||||
sub last_page($self) {
|
sub last_page($self) {
|
||||||
my $thread_count = $self->count;
|
my $thread_count = $self->count;
|
||||||
my $last_page = int($thread_count / $self->{'threads_per_page'});
|
my $last_page = int($thread_count / $self->{'threads_per_page'});
|
||||||
|
@ -83,8 +75,6 @@ sub last_page($self) {
|
||||||
$last_page;
|
$last_page;
|
||||||
}
|
}
|
||||||
|
|
||||||
*get_last_page = \&last_page;
|
|
||||||
|
|
||||||
sub count($self) {
|
sub count($self) {
|
||||||
$self->pg->db->query(<<~'END_SQL')->hash->{'count'}
|
$self->pg->db->query(<<~'END_SQL')->hash->{'count'}
|
||||||
SELECT COUNT(*) AS count
|
SELECT COUNT(*) AS count
|
||||||
|
@ -93,8 +83,6 @@ sub count($self) {
|
||||||
END_SQL
|
END_SQL
|
||||||
}
|
}
|
||||||
|
|
||||||
*get_thread_count = \&count;
|
|
||||||
|
|
||||||
sub by_id($self, $thread_id) {
|
sub by_id($self, $thread_id) {
|
||||||
my $date_format = %$self{'date_format'};
|
my $date_format = %$self{'date_format'};
|
||||||
|
|
||||||
|
@ -109,6 +97,4 @@ sub by_id($self, $thread_id) {
|
||||||
END_SQL
|
END_SQL
|
||||||
}
|
}
|
||||||
|
|
||||||
*get_thread_by_id = \&by_id;
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user