File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
lib/ajax-datatables-rails/orm Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ Layout/EmptyLinesAroundModuleBody:
26
26
Layout/EmptyLineBetweenDefs :
27
27
Enabled : false
28
28
29
+ Metrics/CyclomaticComplexity :
30
+ Max : 7
31
+
29
32
Metrics/LineLength :
30
33
Enabled : false
31
34
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ def filter_records(records)
12
12
records . where ( build_conditions )
13
13
end
14
14
15
+ # rubocop:disable Style/EachWithObject
15
16
def sort_records ( records )
16
17
sort_by = datatable . orders . inject ( [ ] ) do |queries , order |
17
18
column = order . column
@@ -20,6 +21,7 @@ def sort_records(records)
20
21
end
21
22
records . order ( sort_by . join ( ', ' ) )
22
23
end
24
+ # rubocop:enable Style/EachWithObject
23
25
24
26
def paginate_records ( records )
25
27
records . offset ( datatable . offset ) . limit ( datatable . per_page )
You can’t perform that action at this time.
0 commit comments