This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OR support for rails 4 | |
module OrScopes | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Creates a new scope with with all where clauses joined by "OR" | |
# Preserves joins but ignores all other query elements. | |
def or_scopes(scopes, use_joins: true) | |
joins = [] | |
wheres = [] |