I am trying to do something similar to what the Sequel::Model does in terms of chaining dataset methods. However, I am having some issues in doing this. This may be more of a Ruby design question than a Sequel Gem question,
However, I am hoping someone can help me with this issue. Here is what I am trying to do: Item < Sequel::Model(:ITEM) def self.apply_filter(params) c = self.clone # loop c.dataset = c.dataset.where(some criteria here) # end loop c end end And in my "controller", I want to be able to do something like the below where the other apply methods are chained together in a similar fashion. items = Item.apply_filter(params).apply_pagination(params).apply_order_by(params).all The problem is that I don't get back instances of type Item. They are of type Class. Can someone tell me how I should go about achieving this? -- 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.
