Guest User

Untitled

a guest
Jul 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. diff --git a/lib/Jifty/DBI/Column.pm b/lib/Jifty/DBI/Column.pm
  2. index d12ac21..24500dc 100644
  3. --- a/lib/Jifty/DBI/Column.pm
  4. +++ b/lib/Jifty/DBI/Column.pm
  5. @@ -42,6 +42,7 @@ my @handy_attrs = qw/
  6. valid_values
  7. available_values
  8. autocompleted
  9. + no_placeholder
  10. /;
  11.  
  12. # compat: this should probably never exist and be deprecated
  13. @@ -152,6 +153,8 @@ known attributes are:
  14.  
  15. =item documentation
  16.  
  17. +=item no_placeholder
  18. +
  19. =back
  20.  
  21. =cut
  22. diff --git a/lib/Jifty/DBI/Record.pm b/lib/Jifty/DBI/Record.pm
  23. index fcde122..119bf1a 100755
  24. --- a/lib/Jifty/DBI/Record.pm
  25. +++ b/lib/Jifty/DBI/Record.pm
  26. @@ -1140,8 +1140,13 @@ sub load_by_cols {
  27. }
  28. }
  29.  
  30. - push @phrases, "$key $op $function";
  31. - push @bind, $value;
  32. + if ($column_obj and $function eq "?" and $column_obj->no_placeholder) {
  33. + push @phrases, "$key $op ".$self->_handle->quote_value($value);
  34. + } else {
  35. + push @phrases, "$key $op $function";
  36. + push @bind, $value;
  37. + }
  38. +
  39. } elsif ( !defined $hash{$key} ) {
  40. push @phrases, "$key IS NULL";
  41. } else {
Add Comment
Please, Sign In to add comment