Rails 5.0

This commit is contained in:
Patrick Gansterer 2020-09-04 12:57:19 +02:00
parent 2892d5272d
commit 2557645f4f
25 changed files with 367 additions and 186 deletions

View file

@ -1,10 +1,10 @@
require File.expand_path('../boot', __FILE__)
require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
Bundler.require(*Rails.groups)
module Foodsoft
class Application < Rails::Application
@ -13,7 +13,7 @@ module Foodsoft
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be autoloadable.
config.autoload_paths += %W(#{config.root}/lib)
config.eager_load_paths << Rails.root.join('lib')
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
@ -27,6 +27,7 @@ module Foodsoft
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '*.yml')]
config.i18n.available_locales = Pathname.glob(Rails.root.join('config', 'locales', '{??,???}{-*,}.yml')).map{|p| p.basename('.yml').to_s }
config.i18n.default_locale = :en
config.i18n.fallbacks = [:en]
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
@ -34,9 +35,6 @@ module Foodsoft
# Enable escaping HTML in JSON.
config.active_support.escape_html_entities_in_json = true
# This will be the Rails 5 default
config.active_record.raise_in_transactional_callbacks = true
# Use SQL instead of Active Record's schema dumper when creating the database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types