Sha256: a6100b030c0de6d470d619532a19b60f1a75bc9c617cf6811924851664b44c71

Contents?: true

Size: 973 Bytes

Versions: 3

Compression:

Stored size: 973 Bytes

Contents

# frozen_string_literal: true

class DatatableCondStartWith < ComplexDatatable
  def view_columns
    super.deep_merge(first_name: { cond: :start_with })
  end
end

class DatatableCondEndWith < ComplexDatatable
  def view_columns
    super.deep_merge(last_name: { cond: :end_with })
  end
end

class DatatableCondLike < ComplexDatatable
  def view_columns
    super.deep_merge(email: { cond: :like })
  end
end

class DatatableCondStringEq < ComplexDatatable
  def view_columns
    super.deep_merge(email: { cond: :string_eq })
  end
end

class DatatableCondStringIn < ComplexDatatable
  def view_columns
    super.deep_merge(email: { cond: :string_in, formatter: ->(o) { o.split('|') } })
  end
end

class DatatableCondNullValue < ComplexDatatable
  def view_columns
    super.deep_merge(email: { cond: :null_value })
  end
end

class DatatableWithFormater < ComplexDatatable
  def view_columns
    super.deep_merge(last_name: { formatter: ->(o) { o.upcase } })
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ajax-datatables-rails-1.5.0 spec/support/datatables/datatable_cond_string.rb
ajax-datatables-rails-1.4.0 spec/support/datatables/datatable_cond_string.rb
ajax-datatables-rails-1.3.1 spec/support/datatables/datatable_cond_string.rb