Hi All,

Is there any good way to hook a model such that the hook function is run 
*before* a select query is issued to the database?

My use case is a database that is caching resources from a crappy REST 
source that only supports "get resource by ID" and "get all resources 
modified since this timestamp" operations. At the moment the cache is 
updated on a schedule (so is always a little stale, and is read-only to our 
application), and I'd like to try out refreshing the cache on every 
retrieval of a Sequel::Model object.

As far as I can tell I can't use the Sequel::Model#initialize like the 
AfterInitialize 
plugin does, since model objects aren't instantiated unless the dataset 
query returns rows.

Before I wade into datasets to see where/how to hook them, can anybody 
point me at a good spot to look at doing this?

cheers

R.

-- 
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