Skip to content

Commit ea8ef44

Browse files
authored
Merge pull request #1 from j105/fix_rails_5_1_0_warning
Fixed 5.1.0 warning for Method each_value is deprecated
2 parents 2f1eb9e + 5e486f5 commit ea8ef44

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ajax-datatables-rails/base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def fetch_records
7474

7575
def sort_records(records)
7676
sort_by = []
77-
params[:order].each_value do |item|
77+
params[:order].each_pair do |_, item|
7878
sort_by << "#{sort_column(item)} #{sort_direction(item)}"
7979
end
8080
records.order(sort_by.join(", "))
@@ -194,7 +194,7 @@ def sortable_displayed_columns
194194

195195
def generate_sortable_displayed_columns
196196
@sortable_displayed_columns = []
197-
params[:columns].each_value do |column|
197+
params[:columns].each_pair do |_, column|
198198
@sortable_displayed_columns << column[:data] if column[:orderable] == 'true'
199199
end
200200
@sortable_displayed_columns

0 commit comments

Comments
 (0)