app/models/data_table_adapter.rb
def build_column_search_condition (column_name, search_value)
    full_column_name = "#{@model_klass.table_name}.#{column}"

    case Utils.column_type(@model_klass, column_name)
      when :string
        "#{full_column_name} ILIKE '%#{search_value}%'"
      when :integer, :float, :decimal
        if Utils.is_numeric?(search_value)
          "#{full_column_name} = #{search_value}"
        end
      else
        # TODO Support more data types in column search conditions
        nil
    end
  end
# Builds an SQL search condition on a given column.
#
# @param column_name [String] the model's database column name
# @param search_value [String] the search value to apply to the column
#
# @return [String, nil] the search condition, if it makes semantic sense. A
#   search of the id column for a non-number is pointless, for example.
Builds an SQL search condition on a given column.
Builds an SQL search condition on a given column .
def build_column_search_condition (column_name, search_value)
    full_column_name = "#{@model_klass.table_name}.#{column}"
    case Utils.column_type(@model_klass, column_name)
      when :string
        "#{full_column_name} ILIKE '%#{search_value}%'"
      when :integer, :float, :decimal
        if Utils.is_numeric?(search_value)
          "#{full_column_name} = #{search_value}"
        end
      else
        nil
    end
  end
def build_column_search_condition ( column_name , search_value ) full_column_name = "#{@model_klass.table_name}.#{column}" case Utils . column_type ( @model_klass , column_name ) when :string "#{full_column_name} ILIKE '%#{search_value}%'" when :integer , :float , :decimal if Utils . is_numeric? ( search_value ) "#{full_column_name} = #{search_value}" end else nil end end
Builds an SQL search condition on a given column.
Builds an SQL search condition on a given column .
# TODO Support more data types in column search conditions
the search condition, if it makes semantic sense. A search of the id column for a non-number is pointless, for example.
the search condition if it makes semantic sense . A search of the id column for a non - number is pointless for example .
String, nil
column_name
the model's database column name
the model ' s database column name
search_value
the search value to apply to the column
the search value to apply to the column