# SortField via Drb

**URL:** <https://www.ruby-forum.com/t/sortfield-via-drb/148217>\
**Category:** Ferret\
**Created:** [September 10, 2008, 3:44pm UTC](https://www.ruby-forum.com/t/sortfield-via-drb/148217 "2008-09-10T15:44:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [September 10, 2008, 3:44pm UTC](https://www.ruby-forum.com/t/sortfield-via-drb/148217/1 "2008-09-10T15:44:01Z")

</div>

Hi,

we need to use an SortField object so we can specify the column type:

sf\_title = SortField.new(:title, :type =\> :string)

Except SortField objects don’t appear to be marshalled properly across  
DRb.

Luckily you can specify the sort field and reverse option as free form  
text to the query, but you apparently can’t specify the type.

Possible solutions:

- Maybe you can specify the type. Does anyone know how?

- Maybe SortField can be made to marshall. Does anyone know how, or  
where best to start adding this if necessary?

- Maybe we can add this support to Ferret. Doesn’t anyone have any  
clues where to start? We don’t mind doing some C coding 🙂

Thanks in advance!

## John.

[http://johnleach.co.uk](http://johnleach.co.uk)

---

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [September 10, 2008, 4:14pm UTC](https://www.ruby-forum.com/t/sortfield-via-drb/148217/2 "2008-09-10T16:14:38Z")

</div>

Hi!

Do you use aaf? In this case it should work ™, since aaf has  
support for this built in, see

[http://projects.jkraemer.net/acts\_as\_ferret/browser/trunk/plugin/acts\_as\_ferret/lib/ferret\_extensions.rb](http://projects.jkraemer.net/acts_as_ferret/browser/trunk/plugin/acts_as_ferret/lib/ferret_extensions.rb)

If not, feel free to take the marshalling code to monkey patch your  
Ferret - no C coding necessary 😉

Cheers,  
Jens

On 10.09.2008, at 15:43, John L. wrote:

> text to the query, but you apparently can’t specify the type.

–  
Jens Krämer  
webit! Gesellschaft für neue Medien mbH  
Schnorrstraße 76 | 01069 Dresden  
Telefon +49351467660 | Telefax +493514676666  
removed\_email\_address@domain.invalid | [www.webit.de](http://www.webit.de)

Amtsgericht Dresden | HRB 15422  
GF Sven Haubold

---

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [September 10, 2008, 5:36pm UTC](https://www.ruby-forum.com/t/sortfield-via-drb/148217/3 "2008-09-10T17:36:51Z")

</div>

On Wed, 2008-09-10 at 16:07 +0200, Jens KrÃ¤mer wrote:

> Hi!
> 
> Do you use aaf? In this case it should work ™, since aaf has  
> support for this built in

We certainly do use aaf. I’ll take a look why this isn’t working for  
us.

Thanks Jens, you’re awesome as always 🙂

John.

–  
[http://johnleach.co.uk](http://johnleach.co.uk)
