Skip to content

Commit

Permalink
eol spaces, bump version to 0.28
Browse files Browse the repository at this point in the history
  • Loading branch information
gshank committed Apr 3, 2013
1 parent e364d27 commit 1df21de
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion dist.ini
Expand Up @@ -7,7 +7,7 @@ license = Perl_5
copyright_holder = Zbigniew Lukasiak, John Napiorkowski, Alexander Hartmaier
copyright_year = 2013

version = 0.27
version = 0.28

[@Basic]

Expand Down
12 changes: 6 additions & 6 deletions lib/DBIx/Class/ResultSet/RecursiveUpdate.pm
Expand Up @@ -756,18 +756,18 @@ When the array contains elements they are updated if they exist, created when
not and deleted if not included.
RecursiveUpdate defaults to
calling 'set_$rel' to update many-to-many relationships.
calling 'set_$rel' to update many-to-many relationships.
See L<DBIx::Class::Relationship/many_to_many> for details.
set_$rel effectively removes and re-adds all relationship data,
even if the set of related items did not change at all.
If L<DBIx::Class::IntrospectableM2M> is in use, RecursiveUpdate will
If L<DBIx::Class::IntrospectableM2M> is in use, RecursiveUpdate will
look up the corresponding has_many relationship and use this to recursively
update the many-to-many relationship.
update the many-to-many relationship.
While both mechanisms have the same final result, deleting and re-adding
While both mechanisms have the same final result, deleting and re-adding
all relationship data can have unwanted consequences if triggers or
method modifiers are defined or logging modules like L<DBIx::Class::AuditLog>
method modifiers are defined or logging modules like L<DBIx::Class::AuditLog>
are in use.
The traditional "set_$rel" behaviour can be forced by passing
Expand Down Expand Up @@ -828,7 +828,7 @@ Clearing the relationship:
tags => [],
});
Make sure that set_$rel used to update many-to-many relationships
Make sure that set_$rel used to update many-to-many relationships
even if IntrospectableM2M is loaded:
my $dvd = $dvd_rs->recursive_update( {
Expand Down
2 changes: 1 addition & 1 deletion t/lib/DebugObject.pm
Expand Up @@ -23,7 +23,7 @@ sub grep_messages{
sub get_messages{
$_[0]->{messages};
}


sub count_messages{
my ($self, $grep) = @_;
Expand Down
66 changes: 33 additions & 33 deletions t/update_introspectable_m2m.t
Expand Up @@ -2,17 +2,17 @@
#
# I am using DebugObject in t/lib to catch the DBIC debug output
# and regexes to check the messages in order to find out what RU
# realy did.
# realy did.
#
# I think that this is a bad Idea. If the queries produced by
# DBIC change in the future, these tests might fail even though
# DBIC change in the future, these tests might fail even though
# DBIC and RU still behave the same.
#
# I currently have no better idea how to find out weather RU
# called set_$rel for M2Ms or not.
# called set_$rel for M2Ms or not.
# (It shouldn't if IntrospectableM2M is in use)
#
# I prefered this solution over monkeypatching DBIC, which was my
#
# I prefered this solution over monkeypatching DBIC, which was my
# second idea. Any hints are highly welcome!
#
# - lukast
Expand Down Expand Up @@ -50,8 +50,8 @@ ok ! $tag_rs->result_class->can("_m2m_metadata"), "tag-rs has no m2m metadata";
my $dvd_item = $dvd_rs->first;


#
# adding one
#
# adding one
#

my $tag_ids = [$dvd_item->tags_rs->get_column("id")->all];
Expand All @@ -74,8 +74,8 @@ is $dbic_trace->count_messages("^INSERT INTO dvdtag "), 1, "add one: update exec

is $dvd_item->tags_rs->count, 3, "add one: DVD item has 3 tags";

#
# removing one
#
# removing one
#

shift @$tag_ids;
Expand All @@ -96,16 +96,16 @@ is $dbic_trace->count_messages("^INSERT INTO dvdtag "), 0, "remove one: update e
is $dvd_item->tags_rs->count, 2, "remove one: DVD item has 2 tags";


#
# adding recursive
#
# adding recursive
#

#push @$tag_ids, ( 4, 5, 6 );

%updates = (
id => $dvd_item->id,
tags => [
(map { { name => $_->name, id => $_->id } } $dvd_item->tags->all) ,
(map { { name => $_->name, id => $_->id } } $dvd_item->tags->all) ,
{ name => "winnie" },
{ name => "fanny" },
{ name => "sammy" },
Expand All @@ -123,16 +123,16 @@ is $dbic_trace->count_messages("^INSERT INTO tag "), 3, "add several: update exe

is $dvd_item->tags_rs->count, 5, "add several: DVD item has 5 tags";

#
# updating recursive
#
# updating recursive
#

#push @$tag_ids, ( 4, 5, 6 );

%updates = (
id => $dvd_item->id,
tags => [
(map { { name => $_->name."_Changed", id => $_->id } } $dvd_item->tags->all) ,
(map { { name => $_->name."_Changed", id => $_->id } } $dvd_item->tags->all) ,
],
);

Expand All @@ -148,15 +148,15 @@ is $dbic_trace->count_messages("^UPDATE tag "), 5, "add several: update executed
is $dvd_item->tags_rs->count, 5, "add several: DVD item has 5 tags";


#
# updating and removing
#
# updating and removing
#


%updates = (
id => $dvd_item->id,
tags => [
(map { { name => $_->name."More", id => $_->id } } $dvd_item->tags->all) ,
(map { { name => $_->name."More", id => $_->id } } $dvd_item->tags->all) ,
],
);

Expand All @@ -174,15 +174,15 @@ is $dbic_trace->count_messages("^UPDATE tag "), 3, "add several: update executed
is $dvd_item->tags_rs->count, 3, "add several: DVD item has 3 tags";


#
# updating and adding
#
# updating and adding
#


%updates = (
id => $dvd_item->id,
tags => [
(map { { name => $_->name."More", id => $_->id } } $dvd_item->tags->all) ,
(map { { name => $_->name."More", id => $_->id } } $dvd_item->tags->all) ,
{ name => "rob" },
{ name => "bot" },
],
Expand All @@ -201,7 +201,7 @@ is $dbic_trace->count_messages("^UPDATE tag "), 3, "add several: update executed
is $dvd_item->tags_rs->count, 5, "add several: DVD item has 5 tags";


#
#
# removing several
#

Expand All @@ -222,7 +222,7 @@ is $dbic_trace->count_messages("^INSERT INTO dvdtag "), 0, "remove several: upda
is $dvd_item->tags_rs->count, 2, "remove several: DVD item has 2 tags";


#
#
# empty arrayref
#

Expand All @@ -241,7 +241,7 @@ is $dbic_trace->count_messages("^INSERT INTO dvdtag "), 0, "remove all: update e

is $dvd_item->tags_rs->count, 0, "remove all: DVD item has no tags";

#
#
# old set_$rel behaviour
#

Expand Down Expand Up @@ -283,8 +283,8 @@ is $dvd_item->tags_rs->count, 2, "remove several: DVD item has 2 tags";
my $tag_item = $tag_rs->first;


#
# adding one
#
# adding one
#

my $dvd_ids = [$tag_item->dvds_rs->get_column("dvd_id")->all];
Expand All @@ -307,8 +307,8 @@ is $dbic_trace->count_messages("^INSERT INTO dvdtag "), 3, "add one: update exec

is $tag_item->dvds_rs->count, 3, "add one: tag item has 3 dvds";

#
# removing one
#
# removing one
#

shift @$dvd_ids;
Expand All @@ -329,16 +329,16 @@ is $dbic_trace->count_messages("^INSERT INTO dvdtag "), 2, "remove one: update e
is $tag_item->dvds_rs->count, 2, "remove one: tag item has 2 dvds";


#
# adding recursive
#
# adding recursive
#

#push @$dvd_ids, ( 4, 5, 6 );

%updates = (
id => $tag_item->id,
dvds => [
(map { { name => $_->name, id => $_->id } } $tag_item->dvds->all) ,
(map { { name => $_->name, id => $_->id } } $tag_item->dvds->all) ,
{ name => "winnie", owner => 1 },
{ name => "fanny" , owner => 1},
{ name => "sammy" , owner => 1},
Expand All @@ -357,7 +357,7 @@ is $dbic_trace->count_messages("^INSERT INTO dvd "), 3, "add several: update exe
is $tag_item->dvds_rs->count, 5, "add several: tag item has 5 dvds";


#
#
# removing several
#

Expand All @@ -378,7 +378,7 @@ is $dbic_trace->count_messages("^INSERT INTO dvdtag "), 2, "remove several: upda
is $tag_item->dvds_rs->count, 2, "remove several: tag item has 2 dvds";


#
#
# empty arrayref
#

Expand Down

0 comments on commit 1df21de

Please sign in to comment.