On Friday, July 5, 2019 at 12:33:38 PM UTC-7, Artem Kondratev wrote:
>
> Can be solved by using a before_save hook I suppose.
>
> class BankAccountSub < BankAccoun
>   def before_save
>     self.attr = nil
>     super
>   end
> end
>
> As for the first issue - I have yet to research the options, but should't 
>
> BankAccountSub.where(:foo=>1).or(:bar=>2)
>
>
> generate 
>
> SELECT * FROM bank_account_subs WHERE attr IS NULL AND foo = 1 OR bar = 2
>
>
> Considering I have 
> set_dataset dataset.where(attr: nil)
>

It should generate something like:

 SELECT * FROM bank_account_subs WHERE (((attr IS NULL) AND (foo = 1)) OR 
(bar = 2))

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/0a327951-d38c-4822-a267-ff4ef041f551%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to