For booleans I can use this in ruby and it works.
@listing=listing.draft? && listing.published?
But what if I have multiple queries which returns an array or something
Lets say drafts and published are two methods on the model which returns array of listings
so any handy method to get both like && and || in boolean?
If i do below code I can see that only the last query(after &&) gets saved always and the first one(before &&) gets overriden..
@listings=listing.drafts && listing.published
PS: I know I can get each seperately and push that to an array but as there are out of the box methods for booleans is it possible to do that for non boolean queries?
listing.where(status: [:draft, :published]). If you are using enum then replace names(draft and published) with enum values.