-
-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
web: replace 'errormsg' with 'errormsg IS NULL' in most cases
This is implement in an extremely hacky way due to poor DBIx feature support. Ideally, what we'd need is a way to tell DBIx to ignore the errormsg column unless explicitly requested, and to automatically add a computed 'errormsg IS NULL' column in others. Since it does not support that, this commit instead hacks some support via method overrides while taking care to not break anything obvious.
- Loading branch information
Showing
14 changed files
with
69 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,7 @@ let | |
DateTime | ||
DBDPg | ||
DBDSQLite | ||
DBIxClassHelpers | ||
DigestSHA1 | ||
EmailMIME | ||
EmailSender | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package Hydra::Schema::ResultSet::EvaluationErrors; | ||
|
||
use strict; | ||
use utf8; | ||
use warnings; | ||
|
||
use parent 'DBIx::Class::ResultSet'; | ||
|
||
__PACKAGE__->load_components('Helper::ResultSet::RemoveColumns'); | ||
|
||
# Exclude expensive error message values unless explicitly requested, and | ||
# replace them with a summary field describing their presence/absence. | ||
sub search_rs { | ||
my ( $class, $query, $attrs ) = @_; | ||
|
||
unless (exists $attrs->{'select'} || exists $attrs->{'columns'}) { | ||
$attrs->{'+columns'}->{'has_error'} = 'errormsg IS NULL'; | ||
} | ||
push @{ $attrs->{'remove_columns'} }, 'errormsg'; | ||
|
||
return $class->next::method($query, $attrs); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package Hydra::Schema::ResultSet::Jobsets; | ||
|
||
use strict; | ||
use utf8; | ||
use warnings; | ||
|
||
use parent 'DBIx::Class::ResultSet'; | ||
|
||
__PACKAGE__->load_components('Helper::ResultSet::RemoveColumns'); | ||
|
||
# Exclude expensive error message values unless explicitly requested, and | ||
# replace them with a summary field describing their presence/absence. | ||
sub search_rs { | ||
my ( $class, $query, $attrs ) = @_; | ||
|
||
unless (exists $attrs->{'select'} || exists $attrs->{'columns'}) { | ||
$attrs->{'+columns'}->{'has_error'} = 'errormsg IS NULL'; | ||
} | ||
push @{ $attrs->{'remove_columns'} }, 'errormsg'; | ||
|
||
return $class->next::method($query, $attrs); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters