[Jifty-commit] r4085 - in jifty/trunk: lib/Jifty/View/Declare

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Tue Sep 11 18:16:16 EDT 2007


Author: sterling
Date: Tue Sep 11 18:16:14 2007
New Revision: 4085

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/View/Declare/CRUD.pm

Log:
 r11959 at dynpc145:  andrew | 2007-09-11 17:15:52 -0500
 Don't override object_type if the CRUD view package already defines object_type.


Modified: jifty/trunk/lib/Jifty/View/Declare/CRUD.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Declare/CRUD.pm	(original)
+++ jifty/trunk/lib/Jifty/View/Declare/CRUD.pm	Tue Sep 11 18:16:14 2007
@@ -108,7 +108,10 @@
 
     # Override object_type
     no strict 'refs';
-    *{$vclass."::object_type"} = sub { $model };
+    my $object_type = $vclass."::object_type";
+
+    # Avoid the override if object_type() is already defined
+    *{$object_type} = sub { $model } unless defined *{$object_type};
 }
 
 # XXX TODO FIXME This is related to the trimclient branch and performs some


More information about the Jifty-commit mailing list