class ActsAsExplorable::Element::In

Generates a where clause to look up the searched string in the given columns

Public Instance Methods

after_init() click to toggle source
# File lib/acts_as_explorable/element/in.rb, line 6
def after_init
  @query_type = :where
end
render() click to toggle source
# File lib/acts_as_explorable/element/in.rb, line 10
def render
  @parameters.each do |f|
    @query_parts <<
      table[f.to_sym].matches_any(@query_string.map { |q| "%#{q}%" })
  end
  @full_query = @query_parts.inject(:or)
end