use strict;
use vars qw( @ISA $DEBUG );
+use Scalar::Util qw( blessed );
use FS::Record qw( qsearch qsearchs dbh );
@ISA = qw( FS::Record );
sub replace {
my $self = shift;
- my $old = ( ref($_[0]) eq ref($self) )
+ my $old = ( blessed($_[0]) && $_[0]->isa('FS::Record') )
? shift
: $self->replace_old;
( ref($_[0]) eq 'HASH' )
? shift
: { @_ };
+
warn "FS::option_Common::replace called on $self with options ".
join(', ', map "$_ => ". $options->{$_}, keys %$options)
if $DEBUG;