I have the following Sequel model with relationships:

class User < Sequel::Model
  many_to_many  :followed_contacts_activities, join_table:
:followed_contacts, right_key: :contact_id, right_primary_key:
:reference_contact_id, :class=>'SequelAdapter::Activity', read_only:
true
  many_to_many  :followed_companies_activities, join_table:
:followed_companies, right_key: :company_id, right_primary_key:
:reference_company_id, :class=>'SequelAdapter::Activity', read_only:
true
  many_to_many  :followed_users_activities, join_table:
:followed_users, right_key: :follower_id, right_primary_key: :user_id,
:class=>'SequelAdapter::Activity', read_only: true
end

*I can eagerly load the 3 relationships like this:

    scope = SequelAdapter::User.eager(:followed_contacts_activities,
:followed_companies_activities, :followed_users_activities)
    sope = users.where(id: user_id, account_id:
current_user.account.id <http://current_user.account.id>)

    scope.all

But what I really need to do is return one result of all the 3
relationships that is paginated.*
*
I am using the pagination plugin:

Sequel::Database.extension :pagination
*


Cheers

Paul Cowan

Cutting-Edge Solutions (Scotland)

blog:      http://thesoftwaresimpleton.com/
website: http://www.cuttingedgesolutionsscotland.com/

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to