Made ->update not change the hashref passed in (with test.)
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Relationship / Accessor.pm
index b77ce00..e98c9a2 100644 (file)
@@ -84,6 +84,7 @@ sub new {
 
 sub update {
   my ($obj, $attrs, @rest) = @_;
+  $attrs = { %$attrs} if $attrs; # Take copy so we dont change passed hashref
   my $info;
   foreach my $key (keys %{$attrs||{}}) {
     next unless $info = $obj->relationship_info($key);