[Jifty-commit] r4002 - in apps/CASPlus/trunk: lib/CASPlus/Model
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Wed Aug 29 12:49:54 EDT 2007
Author: sterling
Date: Wed Aug 29 12:49:53 2007
New Revision: 4002
Modified:
apps/CASPlus/trunk/ (props changed)
apps/CASPlus/trunk/lib/CASPlus/Model/ProfileRelationship.pm
Log:
r8968 at riddle: andrew | 2007-08-25 19:38:19 -0500
Adding a late call to register_triggers_for_column() for after the relationship has been created.
Modified: apps/CASPlus/trunk/lib/CASPlus/Model/ProfileRelationship.pm
==============================================================================
--- apps/CASPlus/trunk/lib/CASPlus/Model/ProfileRelationship.pm (original)
+++ apps/CASPlus/trunk/lib/CASPlus/Model/ProfileRelationship.pm Wed Aug 29 12:49:53 2007
@@ -82,7 +82,7 @@
Calculated column. Do not modify.
-This column is setup by the class itself during creation. A new column will be created in the parent table according to the given L</parent_name> and L</relation_child>. This will be set to the L<Jifty::Model::ModelClassColumn> object created.
+This column is setup by the class itself during creation. A new column will be created in the child table according to the given L</parent_name> and L</relation_child>. This will be set to the L<Jifty::Model::ModelClassColumn> object created.
=head2 link_table
@@ -421,7 +421,19 @@
# Handle one-to-one and one-to-many relationships
else {
- # TODO XXX FIXME Add more triggers here...
+
+ # This has to be called specially because
+ # register_triggers_for_column gets called too early when the model
+ # class column is created, but the profile relationship does not
+ # yet exist.
+ CASPlus::ProfileMixin::register_triggers_for_column(
+ $args->{relation_child}->record_class,
+ $args->{child_column}->name,
+ );
+ CASPlus::ProfileMixin::register_triggers_for_column(
+ $args->{relation_parent}->record_class,
+ $args->{parent_column}->name,
+ );
}
}
More information about the Jifty-commit
mailing list