We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03a7379 commit 1895169Copy full SHA for 1895169
lib/ajax-datatables-rails/base.rb
@@ -154,12 +154,11 @@ def per_page
154
end
155
156
def sort_column(item)
157
- sortable_column = sortable_columns[item[:column].to_i].split(".")
158
- model, column = sortable_column
159
- unless models[model].nil?
160
- sortable_column = [models[model].table_name.to_s, column].join(".")
161
- end
162
- sortable_column
+ column = sortable_columns[item[:column].to_i]
+ return nil if column.nil?
+ model, col = column.split(".")
+ return [models[model].table_name.to_s, col].join(".") unless models[model].nil?
+ column
163
164
165
def sort_direction(item)
0 commit comments