File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed
lib/ajax-datatables-rails/datatable Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,7 @@ def orderable?
18
18
end
19
19
20
20
def orders
21
- return @orders if @orders
22
- @orders = [ ]
23
- options [ :order ] . each do |_ , order_options |
24
- @orders << SimpleOrder . new ( self , order_options )
25
- end
26
- @orders
21
+ @orders ||= options [ :order ] . to_unsafe_h . with_indifferent_access . map { |index , order_options | SimpleOrder . new ( self , order_options ) }
27
22
end
28
23
29
24
def order_by ( how , what )
@@ -43,12 +38,9 @@ def search
43
38
# ----------------- COLUMN METHODS --------------------
44
39
45
40
def columns
46
- return @columns if @columns
47
- @columns = [ ]
48
- options [ :columns ] . each do |index , column_options |
49
- @columns << Column . new ( datatable , index , column_options )
41
+ @columns ||= options [ :columns ] . to_unsafe_h . with_indifferent_access . map do |index , column_options |
42
+ Column . new ( datatable , index , column_options )
50
43
end
51
- @columns
52
44
end
53
45
54
46
def column_by ( how , what )
You can’t perform that action at this time.
0 commit comments