Skip to content

Commit d2ed7de

Browse files
committed
Memoize values that should not change
1 parent caaa96f commit d2ed7de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ajax-datatables-rails/datatable/column.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ def table
4343
end
4444

4545
def model
46-
source.split('.').first.constantize
46+
@model ||= source.split('.').first.constantize
4747
end
4848

4949
def field
50-
source.split('.').last.to_sym
50+
@field ||= source.split('.').last.to_sym
5151
end
5252

5353
def custom_field?

0 commit comments

Comments
 (0)