Module: WillPaginate::ActiveRecord::RelationMethods

Defined in:
lib/ab_admin/hooks/will_paginate_id_prefetch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#paginate_limitObject

Returns the value of attribute paginate_limit


7
8
9
# File 'lib/ab_admin/hooks/will_paginate_id_prefetch.rb', line 7

def paginate_limit
  @paginate_limit
end

#paginate_offsetObject

Returns the value of attribute paginate_offset


7
8
9
# File 'lib/ab_admin/hooks/will_paginate_id_prefetch.rb', line 7

def paginate_offset
  @paginate_offset
end

Instance Method Details

#offset(value = nil) ⇒ Object


17
18
19
20
21
22
23
# File 'lib/ab_admin/hooks/will_paginate_id_prefetch.rb', line 17

def offset(value = nil)
  if value.nil?
    paginate_offset || offset_value
  else
    super(value)
  end
end

#per_page(value = nil) ⇒ Object


9
10
11
12
13
14
15
# File 'lib/ab_admin/hooks/will_paginate_id_prefetch.rb', line 9

def per_page(value = nil)
  if value.nil?
    paginate_limit || limit_value
  else
    limit(value)
  end
end