Hey Jeremy, I am sorry, that my question was not clear enough. Yes, I want 
paginate method to be available only on friends_dataset. Thats right. The 
only think I don't know is how should I properly access current 
friends_dataset state inside paginate method. So for example if I call:

User[1].friends_dataset.order(:name).paginate

how should I access ordered friends_dataset inside paginate method. And 
also as you can see, friends association has its own dataset defined (as 
described in my first post).

Thanks

On Tuesday, May 7, 2013 5:34:26 PM UTC+2, Jeremy Evans wrote:
>
> On Tuesday, May 7, 2013 6:21:48 AM UTC-7, Petr Kaleta wrote:
>>
>> I've got a model with custom dataset association
>>
>> class User < Sequel::Model
>>
>>   module FriendsPager
>>     def paginate
>>       # filter friends dataset here
>>     end
>>   end
>>
>>   one_to_many :friends, :class => User, :extend => FriendsPager, :dataset 
>> => (proc {|r| ... })
>>
>> end
>>
>> So I want to extend just friends association. My question is, how can I 
>> access friends_dataset from paginate method? So I'll be able to filter it 
>> more etc...
>>
>
> Well, paginate will only be available on friends_dataset.  So I'm guessing 
> that the answer to your question is self.  Usage would be something like:
>
>   User[1].friends_dataset.paginate
>
> If that's not the information you are looking for, you'll have to be more 
> specific.
>
> Thanks,
> Jeremy
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to