0

i have the following query in my app:

Page.where(published: false).where("published_at > current_date").where("publication_end IS NULL OR publication_end < current_date")

Now i want to change this where to or, I was trying:

Page.where((published: false) || ("published_at > current_date"))

but it not working. Is there any way to do it?

mu is too short
  • 426,620
  • 70
  • 833
  • 800
Mateusz Urbański
  • 7,352
  • 15
  • 68
  • 133

1 Answers1

2

This should work:

Page.where('published = ? OR published_at > current_date', false)
Marek Lipka
  • 50,622
  • 7
  • 87
  • 91