[jifty-devel] sort_order in Jifty::DBI Schema definition ignored

Wolfgang Kinkeldei kinkeldei at nureg.de
Mon Oct 30 14:08:15 EST 2006


On 30.10.2006 um 19:46 Jesse Vincent wrote:

> On Mon, Oct 30, 2006 at 07:31:58PM +0100, Wolfgang Kinkeldei wrote:
>> Hello,
>>
>> when setting a 'sort_order' attribute in a column definition for a
>> model, the value given for the 'sort_order' is ignored. Instead, a
>> zero value is assigned to the 'sort_order' attribute every time this
>> attribute is set.
>
>
>>
>> The fix looks like this:
>>
>> --- Jifty-DBI/trunk/lib/Jifty/DBI/Schema.pm     (Revision 2086)
>> +++ Jifty-DBI/trunk/lib/Jifty/DBI/Schema.pm     (Working copy)
>> @@ -346,7 +346,7 @@
>> =cut
>> sub sort_order {
>> -    _item ( sort_order => 0, @_);
>> +    _list ( sort_order => @_);
>
>
> Why isn't the fix
>
>
> +    _item ( sort_order => (shift @_ || 0));
>
> ?

looks better and makes the definition more tolerant to a user  
forgetting to give a value for the sort_order. Right.

Do you apply this change?


Regards,

Wolfgang

-- 

' /\_/\ ' .print[split??,"".(($/=q|Cms)+-03467:;<=|)=~tr!C-z -B! -z!)x
'( o.o )' .$/]->[hex]foreach split qr<>,qq+1ecd039ad65b025b8063475b+||
' > ^ < ' .q<!-- Wolfgang Kinkeldei - mailto:wolfgang at kinkeldei.de -->





More information about the jifty-devel mailing list