Mode code looks something like this. Surely there is a better way to be 
doing this, no?

# model

many_to_many :resources, join_table: :items
one_to_many :items
...

# association model

dataset_module do
  
  def lock_version
    select_map(Sequel.qualify(model.table_name, :lock_version))
  end
end

# controller

def dataset
  model.eager(:items, resources: { original: :proxies })
end

# view

def etag
  [
    collection,
    collection.items_dataset,
    collection.resources_dataset,
    collection.originals_dataset,
    collection.proxies_dataset
  ].map(&:lock_version).join
end

Best,

Jamie

-- 
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/groups/opt_out.

Reply via email to