Skip to content

Commit b1ecc2b

Browse files
committed
Coding style
1 parent cf0366e commit b1ecc2b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

lib/ajax-datatables-rails/datatable/column.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def validate_settings!
9797
:eq, :not_eq, :lt, :gt, :lteq, :gteq, :in,
9898
# Date condition
9999
:date_range
100-
]
100+
].freeze
101101

102102
private_constant :VALID_SEARCH_CONDITIONS
103103

lib/ajax-datatables-rails/datatable/column/date_filter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def range_start_casted
5555
end
5656

5757
def range_end_casted
58-
range_end.blank? ? parse_date("9999-12-31 23:59:59") : parse_date("#{range_end} 23:59:59")
58+
range_end.blank? ? parse_date('9999-12-31 23:59:59') : parse_date("#{range_end} 23:59:59")
5959
end
6060

6161
def parse_date(date)

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ def paginate_records(records)
2626
# ----------------- SEARCH HELPER METHODS --------------------
2727

2828
def build_conditions
29-
@criteria ||= begin
29+
@build_conditions ||= begin
3030
criteria = [build_conditions_for_selected_columns]
3131
criteria << build_conditions_for_datatable if datatable.searchable?
3232
criteria.compact.reduce(:and)
3333
end
3434
end
3535

36+
# rubocop:disable Metrics/AbcSize
3637
def build_conditions_for_datatable
3738
columns = searchable_columns.reject(&:searched?)
3839
criteria = search_for.inject([]) do |crit, atom|
@@ -44,6 +45,7 @@ def build_conditions_for_datatable
4445
end.compact.reduce(:and)
4546
criteria
4647
end
48+
# rubocop:enable Metrics/AbcSize
4749

4850
def build_conditions_for_selected_columns
4951
search_columns.map(&:search_query).compact.reduce(:and)

0 commit comments

Comments
 (0)