Module: ParamsReady::Pagination::Nulls::First

Defined in:
lib/params_ready/pagination/nulls.rb

Class Method Summary collapse

Class Method Details

.if_not_null_predicate(tendency, column, value, nested) ⇒ Object



15
16
17
# File 'lib/params_ready/pagination/nulls.rb', line 15

def self.if_not_null_predicate(tendency, column, value, nested)
  tendency.non_nullable_predicate(column, value, nested)
end

.if_null_predicate(column, nested) ⇒ Object



8
9
10
11
12
13
# File 'lib/params_ready/pagination/nulls.rb', line 8

def self.if_null_predicate(column, nested)
  is_null_and_all = column.eq(nil).and(nested)
  grouping = Arel::Nodes::Grouping.new(is_null_and_all)
  is_not_null = column.not_eq(nil)
  grouping.or(is_not_null)
end