[Rt-commit] r19223 - rt/3.999/branches/config-in-db/lib/RT/Model
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Thu Apr 16 02:28:24 EDT 2009
Author: sunnavy
Date: Thu Apr 16 02:28:24 2009
New Revision: 19223
Modified:
rt/3.999/branches/config-in-db/lib/RT/Model/Config.pm
Log:
add _get method so we can get raw value stored in Config
Modified: rt/3.999/branches/config-in-db/lib/RT/Model/Config.pm
==============================================================================
--- rt/3.999/branches/config-in-db/lib/RT/Model/Config.pm (original)
+++ rt/3.999/branches/config-in-db/lib/RT/Model/Config.pm Thu Apr 16 02:28:24 2009
@@ -68,6 +68,21 @@
updated_on => 'last_updated',
};
+sub _get {
+ my $self = shift;
+ my $name = shift;
+
+ my $config = RT::Model::Config->new;
+ my ( $ret, $msg ) = $config->load_by_cols( name => $name );
+ if ($ret) {
+ my $value = $config->value;
+ return defined $value ? $value : '';
+ }
+ else {
+ return;
+ }
+}
+
sub get {
my $self = shift;
my $name = shift;
@@ -83,13 +98,10 @@
}
}
- my $config = RT::Model::Config->new;
- my ( $ret, $msg ) = $config->load_by_cols( name => $name );
- if ($ret) {
- my $value = $config->value;
-# $value = $$value if ref $value;
+ my $value = $self->_get( $name );
+ if ( defined $value ) {
$value =~ s/{{(\w+)}}/$self->get($1) || ''/ge if $value && !ref $value;
- return defined $value ? $value : '';
+ return $value;
}
else {
return;
More information about the Rt-commit
mailing list