John Siracusa wrote:
> On 9/13/07, Wiggins d'Anconia <[EMAIL PROTECTED]> wrote:
>> $sort_by  = join(', ', map { ref $_ ? $$_ : $_ } @$sort_by)   if(ref
>> $sort_by);
>>
>> In the above any argument that is a reference attempts to dereference a
>> scalar, which is problematic for obviously anything that is not a
>> scalar, which in our case was specifically causing an error when we
>> tried to set the sort_by values to the primary key columns directly,
>>
>> $args{get_objects_args}->{sort_by} =
>>      $_model_class->meta->primary_key_columns;
> 
> The docs for sort_by say it accepts "strings or scalar references", so
> the only kind of reference should be a scalar ref.  Thus the lack of a
> check for ref eq 'SCALAR'.  To provide strings, try this instead:
> 
>   $args{get_objects_args}->{sort_by} =
>     $_model_class->meta->primary_key_column_names;
> 
> I'll add the ref check anyway, but I just wanted to point out that you
> were violating the documented API earlier :)
> 
> -John
> 

Yeah was wondering about that, should have checked first, sorry. Though 
I do think you should be able to pass it an object that stringifies, 
especially one provided by Rose itself :-).

Thanks for the adjustment even outside of a pre-documented API,

http://danconia.org

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to