1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00
fab-manager/config/application.rb

89 lines
3.1 KiB
Ruby
Raw Normal View History

2019-09-25 16:37:42 +02:00
# frozen_string_literal: true
2020-03-11 16:18:17 +01:00
require_relative 'boot'
2015-05-05 03:10:25 +02:00
require 'csv'
2020-09-09 11:54:49 +02:00
require 'active_record/railtie'
require 'active_storage/engine'
require 'action_controller/railtie'
require 'action_view/railtie'
require 'action_mailer/railtie'
require 'active_job/railtie'
# require 'action_cable/engine'
require 'rails/test_unit/railtie'
2020-09-09 11:54:49 +02:00
# require 'sprockets/railtie'
2016-03-23 18:39:41 +01:00
require 'elasticsearch/rails/instrumentation'
require 'elasticsearch/persistence/model'
2015-05-05 03:10:25 +02:00
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
2023-02-24 17:26:55 +01:00
# module declaration
module FabManager; end
# Fab-Manager is the FabLab management solution. It provides a comprehensive, web-based, open-source tool to simplify your
# administrative tasks and your marker's projects.
class FabManager::Application < Rails::Application
require 'fab_manager'
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.0
# prevent this new behavior with rails >= 5.0
# see https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#active-record-belongs-to-required-by-default-option
config.active_record.belongs_to_required_by_default = false
config.active_record.schema_format = :sql
2023-03-23 17:39:06 +01:00
config.active_record.yaml_column_permitted_classes = [Symbol, Date, Time]
2023-02-24 17:26:55 +01:00
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
config.time_zone = Rails.application.secrets.time_zone
config.to_prepare do
Devise::Mailer.layout 'notifications_mailer'
end
2015-05-05 03:10:25 +02:00
2023-02-24 17:26:55 +01:00
config.active_job.queue_adapter = :sidekiq
2015-05-05 03:10:25 +02:00
2023-02-24 17:26:55 +01:00
config.generators do |g|
g.orm :active_record
g.test_framework :mini_test
end
2016-03-23 18:39:41 +01:00
2023-02-24 17:26:55 +01:00
# load locales for subdirectories
config.i18n.load_path += Dir[Rails.root.join('config/locales/**/*.yml').to_s]
2016-09-05 16:26:28 +02:00
2023-02-24 17:26:55 +01:00
# enable the app to find locales in plugins locales directory
config.i18n.load_path += Dir[Rails.root.join('plugins/*/config/locales/*.yml').to_s]
2016-05-10 16:50:01 +02:00
2023-02-24 17:26:55 +01:00
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
2023-02-24 17:26:55 +01:00
# enable the app to find views in plugins views directory
Dir[Rails.root.join('plugins/*/views').to_s].each do |path|
Rails.application.config.paths['app/views'] << path
end
2023-02-24 17:26:55 +01:00
# disable ANSI color escape codes in active_record if NO_COLOR is defined.
config.colorize_logging = ENV['NO_COLOR'] ? false : true
2023-02-24 17:26:55 +01:00
FabManager.activate_plugins!
2016-05-10 16:50:01 +02:00
2023-02-24 17:26:55 +01:00
config.action_view.sanitized_allowed_tags = %w[a acronym hr pre table b strong i em li ul ol h1 h2 h3 h4 h5 h6 blockquote br cite sub sup ins p
image iframe style]
2022-07-27 10:28:58 +02:00
2023-02-24 17:26:55 +01:00
config.after_initialize do
plugins = FabManager.plugins
plugins&.each(&:notify_after_initialize)
2023-02-24 17:26:55 +01:00
require 'version'
Version.check
2015-05-05 03:10:25 +02:00
end
end