lib/ajax-datatables-rails.rb in ajax-datatables-rails-1.1.0 vs lib/ajax-datatables-rails.rb in ajax-datatables-rails-1.2.0
- old
+ new
@@ -1,3 +1,30 @@
# frozen_string_literal: true
-require 'ajax_datatables_rails'
+require 'active_support/configurable'
+
+require 'zeitwerk'
+loader = Zeitwerk::Loader.for_gem
+generators = "#{__dir__}/generators"
+loader.ignore(generators)
+loader.inflector.inflect(
+ 'orm' => 'ORM',
+ 'ajax-datatables-rails' => 'AjaxDatatablesRails'
+)
+loader.setup
+
+module AjaxDatatablesRails
+ # Configure AjaxDatatablesRails global settings
+ #
+ # AjaxDatatablesRails.configure do |config|
+ # config.db_adapter = :postgresql
+ # end
+
+ def self.configure
+ yield @config ||= AjaxDatatablesRails::Configuration.new
+ end
+
+ # AjaxDatatablesRails global settings
+ def self.config
+ @config ||= AjaxDatatablesRails::Configuration.new
+ end
+end