application.rb 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. require_relative "boot"
  2. require "rails"
  3. require "active_model/railtie"
  4. require "active_job/railtie"
  5. require "active_record/railtie"
  6. # require "active_storage/engine"
  7. require "action_controller/railtie"
  8. require "action_mailer/railtie"
  9. require "action_view/railtie"
  10. # require "action_cable/engine"
  11. require "sprockets/railtie"
  12. require "rails/test_unit/railtie"
  13. # Require the gems listed in Gemfile, including any gems
  14. # you've limited to :test, :development, or :production.
  15. Bundler.require(*Rails.groups)
  16. module Huginn
  17. class Application < Rails::Application
  18. Dotenv.overload File.expand_path('../../spec/env.test', __FILE__) if Rails.env.test?
  19. # Initialize configuration defaults for originally generated Rails version.
  20. config.load_defaults 6.1
  21. # Configuration for the application, engines, and railties goes here.
  22. #
  23. # These settings can be overridden in specific environments using the files
  24. # in config/environments, which are processed later.
  25. # Custom directories with classes and modules you want to be autoloadable.
  26. config.autoload_paths += %W(#{config.root}/lib #{config.root}/app/presenters #{config.root}/app/jobs)
  27. # Activate observers that should always be running.
  28. # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
  29. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
  30. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
  31. config.time_zone = ENV['TIMEZONE'].presence || "Pacific Time (US & Canada)"
  32. # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
  33. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
  34. # config.i18n.default_locale = :de
  35. # Configure the default encoding used in templates for Ruby 1.9.
  36. config.encoding = "utf-8"
  37. # Enable escaping HTML in JSON.
  38. config.active_support.escape_html_entities_in_json = true
  39. # Use SQL instead of Active Record's schema dumper when creating the database.
  40. # This is necessary if your schema can't be completely dumped by the schema dumper,
  41. # like if you have constraints or database-specific column types
  42. # config.active_record.schema_format = :sql
  43. config.active_job.queue_adapter = :delayed_job
  44. config.action_view.sanitized_allowed_tags = %w[strong em b i p code pre tt samp kbd var sub sup dfn cite big small address hr br div span h1 h2 h3 h4 h5 h6 ul ol li dl dt dd abbr acronym a img blockquote del ins style table thead tbody tr th td]
  45. config.action_view.sanitized_allowed_attributes = %w[href src width height alt cite datetime title class name xml:lang abbr border cellspacing cellpadding valign style]
  46. config.active_record.yaml_column_permitted_classes = [Symbol, Date, Time]
  47. ActiveSupport::XmlMini.backend = 'Nokogiri'
  48. end
  49. end