$soarefresh $soaretry
);
use Carp;
+use Scalar::Util qw( blessed );
use Date::Format;
#use Net::Whois::Raw;
use Net::Domain::TLD qw(tld_exists);
=cut
sub replace {
- my ( $new, $old ) = ( shift, shift );
+ my $new = shift;
- # We absolutely have to have an old vs. new record to make this work.
- $old = $new->replace_old unless defined($old);
+ my $old = ( blessed($_[0]) && $_[0]->isa('FS::Record') )
+ ? shift
+ : $new->replace_old;
return "Can't change domain - reorder."
if $old->getfield('domain') ne $new->getfield('domain');