vendor/plugins/active_scaffold/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 condition_for_integer_type(column, value, like_pattern)
        if column.options[:format]
          value['from'] = column.number_to_native(value['from'])
          value['to'] = column.number_to_native(value['to'])
        end
        if value['from'].blank? or not ActiveScaffold::Finder::NumericComparators.include?(value['opt'])
          nil
        elsif value['opt'] == 'BETWEEN'
          ["#{column.search_sql} BETWEEN ? AND ?", value['from'].to_f, value['to'].to_f]
        else
          ["#{column.search_sql} #{value['opt']} ?", value['from'].to_f]
        end
      end
def condition_for_integer_type ( column , value , like_pattern ) if column . options [ :format ] value [ 'from' ] = column . number_to_native ( value [ 'from' ] ) value [ 'to' ] = column . number_to_native ( value [ 'to' ] ) end if value [ 'from' ] . blank? or not ActiveScaffold :: Finder :: NumericComparators . include? ( value [ 'opt' ] ) nil elsif value [ 'opt' ] == 'BETWEEN' [ "#{column.search_sql} BETWEEN ? AND ?" , value [ 'from' ] . to_f , value [ 'to' ] . to_f ] else [ "#{column.search_sql} #{value['opt']} ?" , value [ 'from' ] . to_f ] end 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 .
column
<not_specific>
value
<not_specific>
like_pattern
<not_specific>