spec/support/helpers/params.rb in ajax-datatables-rails-1.3.0 vs spec/support/helpers/params.rb in ajax-datatables-rails-1.3.1
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
# rubocop:disable Metrics/MethodLength
def sample_params
ActionController::Parameters.new(
{
'draw' => '1',
@@ -40,11 +42,11 @@
'value' => '', 'regex' => 'false'
}
},
},
'order' => {
- '0' => {'column' => '0', 'dir' => 'asc'}
+ '0' => { 'column' => '0', 'dir' => 'asc' },
},
'start' => '0', 'length' => '10', 'search' => {
'value' => '', 'regex' => 'false'
},
'_' => '1423364387185'
@@ -52,21 +54,21 @@
)
end
def sample_params_json
hash_params = sample_params.to_unsafe_h
- hash_params["columns"] = hash_params["columns"].values
- hash_params["order"] = hash_params["order"].values
+ hash_params['columns'] = hash_params['columns'].values
+ hash_params['order'] = hash_params['order'].values
ActionController::Parameters.new(hash_params)
end
# rubocop:enable Metrics/MethodLength
def nulls_last_sql(datatable)
case datatable.db_adapter
when :pg, :postgresql, :postgres, :oracle
- "NULLS LAST"
+ 'NULLS LAST'
when :mysql, :mysql2, :sqlite, :sqlite3
- "IS NULL"
+ 'IS NULL'
else
raise 'unsupported database adapter'
end
end