lib/active_scaffold/finder.rb
# Takes a collection of search terms (the tokens) and creates SQL that
# searches all specified ActiveScaffold columns. A row will match if each
# token is found in at least one of the columns.
Takes a collection of search terms (the tokens) and creates SQL that
searches all specified ActiveScaffold columns. A row will match if each
token is found in at least one of the columns.
Takes a collection of search terms ( the tokens ) and creates SQL that searches all specified ActiveScaffold columns . A row will match if each token is found in at least one of the columns .
def conditions_for_columns(tokens, columns, text_search = :full)
        return unless columns.any?
        tokens = [tokens] if tokens.is_a? String
        tokens = type_casted_tokens(tokens, columns, like_pattern(text_search))
        create_conditions_for_columns(tokens, columns)
      end
def conditions_for_columns ( tokens , columns , text_search = :full ) return unless columns . any? tokens = [ tokens ] if tokens . is_a? String tokens = type_casted_tokens ( tokens , columns , like_pattern ( text_search ) ) create_conditions_for_columns ( tokens , columns ) end
Takes a collection of search terms (the tokens) and creates SQL that
searches all specified ActiveScaffold columns.
Takes a collection of search terms ( the tokens ) and creates SQL that searches all specified ActiveScaffold columns .
# if there aren't any columns, then just return a nil condition
tokens
<not_specific>
columns
<not_specific>
text_search
<not_specific>