File: engine.rb

package info (click to toggle)
ruby-bootstrap-form 5.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 520 kB
  • sloc: ruby: 1,447; makefile: 4
file content (22 lines) | stat: -rw-r--r-- 712 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

require "rails/railtie"

module BootstrapForm
  class Engine < Rails::Engine
    config.eager_load_namespaces << BootstrapForm
    config.autoload_paths << File.expand_path("lib", __dir__)

    config.bootstrap_form = BootstrapForm.config
    config.bootstrap_form.default_form_attributes ||= {}
    config.bootstrap_form.group_around_collections = Rails.env.development? if config.bootstrap_form.group_around_collections.nil?

    initializer "bootstrap_form.configure" do |app|
      BootstrapForm.config = app.config.bootstrap_form
    end

    initializer "bootstrap_form.deprecator" do |app|
      app.deprecators[:bootstrap_form] = BootstrapForm.deprecator
    end
  end
end