File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
lib/ajax-datatables-rails/datatable
spec/ajax-datatables-rails/datatable Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -20,14 +20,19 @@ def column
2020 end
2121
2222 def direction
23- DIRECTIONS . find { |dir | dir == @options [ :dir ] . upcase } || 'ASC'
23+ DIRECTIONS . find { |dir | dir == column_direction } || 'ASC'
2424 end
2525
2626 private
2727
2828 def column_index
2929 @options [ :column ]
3030 end
31+
32+ def column_direction
33+ @options [ :dir ] . upcase
34+ end
35+
3136 end
3237 end
3338end
Original file line number Diff line number Diff line change 22
33describe AjaxDatatablesRails ::Datatable ::SimpleOrder do
44
5- let ( :options ) { ActiveSupport ::HashWithIndifferentAccess . new ( { 'column' => '1' , 'dir' => 'desc' } ) }
5+ let ( :options ) { ActiveSupport ::HashWithIndifferentAccess . new ( { 'column' => '1' , 'dir' => 'desc' } ) }
66 let ( :simple_order ) { AjaxDatatablesRails ::Datatable ::SimpleOrder . new ( nil , options ) }
77
88 describe 'option methods' do
You can’t perform that action at this time.
0 commit comments