How to check for non-null in Ruby :: Sequel?

I want to do something like

User.select(...).where(:name != nil) 

not recording something like

 User.select(...).to_a.find_all {|user| user.name} 

I can choose null values, but not for non-empty ones. Is there a trick or Sequel external domain?

+6
source share
2 answers

You can use exclude instead of where .

 User.select(...).exclude(name: nil) 
+18
source

You can do it:

 User.select(...).where('name IS NOT NULL') 
+5
source

Source: https://habr.com/ru/post/969879/


All Articles