Skip to content

Commit 7da3aab

Browse files
fix: prevent establishing ActiveRecord connection on startup
1 parent 5b81aed commit 7da3aab

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/ajax-datatables-rails/base.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@
33
module AjaxDatatablesRails
44
class Base
55

6-
class_attribute :db_adapter, default: ::ActiveRecord::Base.connection.adapter_name.downcase.to_sym
6+
class_attribute :db_adapter
77
class_attribute :nulls_last, default: false
88

9+
class << self
10+
def db_adapter
11+
self.db_adapter = ::ActiveRecord::Base.connection.adapter_name.downcase.to_sym
12+
end
13+
end
14+
915
attr_reader :params, :options, :datatable
1016

1117
GLOBAL_SEARCH_DELIMITER = ' '

0 commit comments

Comments
 (0)