fix error
This commit is contained in:
parent
0d8972ea29
commit
f072515fa7
|
@ -49,15 +49,16 @@ class TableEntry
|
||||||
if (field=='created_at' || field == 'sort_number')
|
if (field=='created_at' || field == 'sort_number')
|
||||||
if column_entries.nil?
|
if column_entries.nil?
|
||||||
values = self.order_by({field => direction})
|
values = self.order_by({field => direction})
|
||||||
if !per.nil?
|
|
||||||
values = values.page(page_num).per(per)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
values = column_entries.map{|v| v.table_entry}
|
values = column_entries.map{|v| v.table_entry}
|
||||||
values = values.sort_by{|v| v.send(field)}
|
values = values.sort_by{|v| v.send(field)}
|
||||||
if direction == 'desc'
|
if direction == 'desc'
|
||||||
values = values.reverse
|
values = values.reverse
|
||||||
end
|
end
|
||||||
|
values = Kaminari.paginate_array(values,limit: values.count)
|
||||||
|
end
|
||||||
|
if !per.nil?
|
||||||
|
values = values.page(page_num).per(per)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
column_to_sort = field
|
column_to_sort = field
|
||||||
|
|
Loading…
Reference in New Issue