Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Not in Rails it's not that simple
scope :without_instagram_videos, -> { where.not('type = ? AND origin = ?', "Video", "instagram") }
#scope :without_instagram_videos, -> { where("type != ? AND origin != ?", "Video", "instagram") }
#scope :without_instagram_videos, -> { where("type IS DISTINCT FROM ? AND origin IS DISTINCT FROM ?", "Video", "instagram") }
#scope :without_instagram_videos, -> { where(type: ['Gallery', 'Video', 'BlogEntry'], origin: [nil, "oyalaa", "youtube", "5"]) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.