8000 Coding style [ci skip] · jbox-web/ajax-datatables-rails@df625c4 · GitHub
[go: up one dir, main page]

Skip to content

Commit df625c4

Browse files
committed
Coding style [ci skip]
1 parent da7fb0e commit df625c4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ Layout/EmptyLinesAroundModuleBody:
2626
Layout/EmptyLineBetweenDefs:
2727
Enabled: false
2828

29+
Metrics/CyclomaticComplexity:
30+
Max: 7
31+
2932
Metrics/LineLength:
3033
Enabled: false
3134

lib/ajax-datatables-rails/orm/active_record.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def filter_records(records)
1212
records.where(build_conditions)
1313
end
1414

15+
# rubocop:disable Style/EachWithObject
1516
def sort_records(records)
1617
sort_by = datatable.orders.inject([]) do |queries, order|
1718
column = order.column
@@ -20,6 +21,7 @@ def sort_records(records)
2021
end
2122
records.order(sort_by.join(', '))
2223
end
24+
# rubocop:enable Style/EachWithObject
2325

2426
def paginate_records(records)
2527
records.offset(datatable.offset).limit(datatable.per_page)

0 commit comments

Comments
 (0)
0