Sha256: b99c76d6362d234f468ce434b0f0b6bed16c775f2a7959ff750c4eb89dc5c10a

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

class DatatableCondEq < ComplexDatatable
  def view_columns
    super.deep_merge(post_id: { cond: :eq })
  end
end

class DatatableCondNotEq < ComplexDatatable
  def view_columns
    super.deep_merge(post_id: { cond: :not_eq })
  end
end

class DatatableCondLt < ComplexDatatable
  def view_columns
    super.deep_merge(post_id: { cond: :lt })
  end
end

class DatatableCondGt < ComplexDatatable
  def view_columns
    super.deep_merge(post_id: { cond: :gt })
  end
end

class DatatableCondLteq < ComplexDatatable
  def view_columns
    super.deep_merge(post_id: { cond: :lteq })
  end
end

class DatatableCondGteq < ComplexDatatable
  def view_columns
    super.deep_merge(post_id: { cond: :gteq })
  end
end

class DatatableCondIn < ComplexDatatable
  def view_columns
    super.deep_merge(post_id: { cond: :in })
  end
end

class DatatableCondInWithRegex < DatatableCondIn
  def view_columns
    super.deep_merge(post_id: { cond: :in, use_regex: false, orderable: true, formater: ->(str) { cast_regex_value(str) } })
  end

  def cast_regex_value(value)
    value.split('|').map(&:to_i)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ajax-datatables-rails-0.4.3 spec/support/datatable_cond_numeric.rb
ajax-datatables-rails-0.4.2 spec/support/datatable_cond_numeric.rb