Hi,

I am in the process of porting some code from active record to sequel. One 
of them is called activerecord_perverted.rb :)

What it does is to check if a table, in which a model is based on, contains 
a specific column name, e.g. REPO_ID. If it does, append a where clause 
automatically with something like REPO_ID = 'XYZ'. (XYZ is determined 
dynamically depending on environment)

Essentially, this behaviour is applied to most of my models (90%+). Only a 
handful of table does not have the REPO_ID column.

Is it possible to achieve the same in sequel?

Many thanks
Roy

p.s. here is skeleton of the current code:

module ActiveRecord
 class Base
  class << self
   def find_every(options)
    if columns_hash.include?("repo_id")
     conditions = options[:conditions]
     new_conditions = add_conditions(conditions) # append extra where clause
     options.update(:conditions => new_conditions)
    end
   end
  end
 end
end

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

Reply via email to