Whoops, this isn't right
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Ordered.pm
index ed726de..4499d86 100644 (file)
@@ -434,10 +434,7 @@ if multiple grouping columns are in use.
 sub move_to_group {
     my( $self, $to_group, $to_position ) = @_;
 
-    $self->throw_exception ('move_to_group() expects a group specification')
-        unless defined $to_group;
-
-    # if we're given a string, turn it into a hashref
+    # if we're given a single value, turn it into a hashref
     unless (ref $to_group eq 'HASH') {
         my @gcols = $self->_grouping_columns;
 
@@ -504,7 +501,7 @@ sub move_to_group {
     }
     else {
       my $bumped_pos_val = $self->_position_value ($to_position);
-      my @between = ($to_position, $new_group_last_position);
+      my @between = map { $self->_position_value ($_) } ($to_position, $new_group_last_position);
       $self->_shift_siblings (1, @between);   #shift right
       $self->set_column( $position_column => $bumped_pos_val );
     }
@@ -564,7 +561,7 @@ sub update {
     # these steps are necessary to keep the external appearance of
     # ->update($upd) so that other things overloading update() will
     # work properly
-    my %original_values = $self->get_inflated_columns;
+    my %original_values = $self->get_columns;
     my %existing_changes = $self->get_dirty_columns;
 
     # See if any of the *supplied* changes would affect the ordering