On Saturday, May 4, 2013 11:45:31 PM UTC-7, [email protected] wrote:

> Hi All,
>
> I'm using STI and have it working just fine. My question is is there a way 
> on my subclasses to specify which columns to select to avoid selecting data 
> that will always be null?
>

You could try this in the subclass:

  set_dataset(dataset.select(*(columns - [:ignore_column1, :ignore_column2, 
...])))

I'm don't think that will handle grandchild classes correctly currently (I 
can probably fix that).

Wasn't sure if it's ok to override the columns method and strip out the 
> unused columns or not?
>

Assuming the dataset has the correct columns selected, you shouldn't need 
to override the columns method.  Even if you did override it, it doesn't 
affect which columns are selected.

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 http://groups.google.com/group/sequel-talk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to