Sha256: 5c51307e9e14c1bd3fa777aea1625714da0bb8adf1a6f49eb7ce2ac604853360

Contents?: true

Size: 262 Bytes

Versions: 7

Compression:

Stored size: 262 Bytes

Contents

class DatatableCondProc < ComplexDatatable
  def view_columns
    super.deep_merge(username: { cond: custom_filter })
  end

  private

  def custom_filter
    ->(column, value) { ::Arel::Nodes::SqlLiteral.new(column.field.to_s).matches("#{value}%") }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ajax-datatables-rails-1.3.0 spec/support/datatables/datatable_cond_proc.rb
ajax-datatables-rails-1.2.0 spec/support/datatable_cond_proc.rb
ajax-datatables-rails-1.1.0 spec/support/datatable_cond_proc.rb
ajax-datatables-rails-1.0.0 spec/support/datatable_cond_proc.rb
ajax-datatables-rails-0.4.3 spec/support/datatable_cond_proc.rb
ajax-datatables-rails-0.4.2 spec/support/datatable_cond_proc.rb
ajax-datatables-rails-0.4.1 spec/support/datatable_cond_proc.rb