Hi Jeremy, Thanks for the reply. Is there a way I can make such a model's deleting/updating/inserting functionalities?
I tried implementing a model as suggested here: http://stackoverflow.com/questions/11022025/sequel-model-over-two-joined-tables <http://www.google.com/url?q=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F11022025%2Fsequel-model-over-two-joined-tables&sa=D&sntz=1&usg=AFQjCNFbFA_PjriH3kv4RUUrNoFcCcSZiA>, but not with a joined dataset(by losing the functionality of dataset filtering of other table). Is there a way I can make both work (dataset filtering using fields on other table and making delete/update functionalities working) in one model? Thanks, Satya On Thursday, May 12, 2016 at 10:09:50 PM UTC+5:30, Jeremy Evans wrote: > > On Thursday, May 12, 2016 at 9:26:26 AM UTC-7, Satyanarayana Gandham wrote: >> >> Hi, >> >> I am trying to create a class whose information is in two separate >> tables. The class's dataset is a joined dataset(because information is in >> two separate tables). Is it possible? Can I create a class whose dataset is >> a joined dataset. >> > > Yes: > > ds = DB[:a].join(:b, :id=>:b_id) > class JoinedModel < Sequel::Model(ds) > end > > Such a model is read-only though, deleting/updating/inserting would not > work. > > Thanks, > Jeremy > -- 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.
