restful_controller 0.1.5 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/restful/base.rb +6 -3
- data/lib/restful/version.rb +1 -1
- data/test/alternates_controller_test.rb +1 -1
- data/test/base_controller_test.rb +1 -1
- data/test/blocks_controller_test.rb +4 -4
- data/test/custom_notices_controller_test.rb +2 -2
- data/test/dummy/app/controllers/blocks_controller.rb +1 -1
- data/test/dummy/bin/rails +1 -1
- data/test/dummy/bin/setup +34 -0
- data/test/dummy/bin/update +29 -0
- data/test/dummy/config/application.rb +5 -17
- data/test/dummy/config/boot.rb +2 -4
- data/test/dummy/config/cable.yml +9 -0
- data/test/dummy/config/environment.rb +2 -2
- data/test/dummy/config/environments/development.rb +30 -5
- data/test/dummy/config/environments/production.rb +37 -31
- data/test/dummy/config/environments/test.rb +10 -4
- data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/test/dummy/config/initializers/mime_types.rb +0 -1
- data/test/dummy/config/initializers/new_framework_defaults.rb +23 -0
- data/test/dummy/config/initializers/session_store.rb +1 -1
- data/test/dummy/config/initializers/wrap_parameters.rb +2 -2
- data/test/dummy/config/puma.rb +47 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/config/spring.rb +6 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +0 -11
- data/test/dummy/log/test.log +9623 -105196
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/0Q/0QppU-9EhYT7x4BnYZD_titkxF30LmbOn7NEVZk8Yo4.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/7E/7ENv2BQvPsGd83J_e6ddH5FrgCnDX6iBxy2WDFc7xWI.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/8M/8McQnwxVQ-W4VBf4Lg-RKBLEsOSnTBeMLwxwGwU6Mr0.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/99/99RXuREqkVrlX_fspL_j2Mzxc3E9GKBSfahbI-Wouro.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/9r/9ryO-j4fsAK10KK2WOeTMoSpBDI8QFF0X-AOBKK4sCg.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/EU/EUoN0mqGWGDaRelMCH25zmw4ckyxbrY9l5e_pXBL0XE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Fb/Fba9qfpGSWE4JxgH5gqjKXNCd_llg-AmZI2oFXb5wVw.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/HG/HGyLsbSq14FKLTeV3N2F7B7Zrxl_OvloSlV2wtkVUl0.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/QH/QHonD6yuQdHuTnML3LDGymUooGQj_APHbaX3Kzno-KI.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Qm/QmgbH9wFqeM2N4ET4GLEFzCNJp5-jM0YLOx9jPoKnTw.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/V7/V7XDDUN0LzPu2IADecQJYYu1Um0RBqyWchERlECdPZc.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/ZG/ZGSFoIVIr1KBkHxxWDz1bBtkz0KadfweIFjWqeTty9k.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/_6/_6ClsWjX8jjRbPAU8R0QXQMqb98DMAWN3h7VaZYU_zs.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/ak/akSvUGUaxnoVGDWdSTnvrgDQRtEiEipDI3gbMG9ORr4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/gW/gWP-FIIzxpctJPRtn79MYxNJ9rMsX0bnEtFKDqsx1Pc.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/hj/hj8Ir9wcVSy1KYrnWu9bpD24vDhCG3tvt-nKbNxb1Wg.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/jE/jETDB5GxGzfVBEJ_-U0TVAzA24QtG8pRXXf5yaoMBnU.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/lm/lmPl08zo5wLyVwMJjvMqEdjT2q9x4xn0hcnN8ycXA5Q.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/nU/nUlbBaGaCfa72Mj9xnbOCnkKHHOt-JQVqufhpYYdvns.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/oC/oCsZTGZyV4kH8Y4OeSDUdrwfkJFPzTODZjuBKZB8oGQ.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/q6/q6BYa32YJF11eGVapO4ouNl6gayPIsARgMavlzZmoi0.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/sH/sHrKkHl6SYOhHWH6F-guhFIo6QPeiF_lJXwhFpUHYjE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/x7/x7KkTV3ibfIEysLB_ug5bfmnn2VLV_BldukPR3EoPBk.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/zz/zzMAmHN5Sf7GBPaZG3P3axOLofCau19RjhhsipNigfs.cache +1 -0
- data/test/prefix_controller_test.rb +7 -7
- data/test/support/base_actions.rb +15 -26
- data/test/test_helper.rb +0 -9
- metadata +96 -42
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c86fe3cf54305c3c7d1a1cb15279ed126c72a147
|
4
|
+
data.tar.gz: ccb03fc65324b5a9a5de62ff9339692ea5a3237c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b0c6420f98e2265fd99d4652491277e46f1962ec77d5d2b685ac428591584e862d504a3469ac8825db11a208e0c59182b0af6c99307bfe67e92285965d3a2e6
|
7
|
+
data.tar.gz: e091d43deb32a44975fed7db8a22564cdf3c45ebe40151dfaeb200025872917ff62212a24ee5d6b41c43f86dda265845dee80cf20f0e82c4eb6a19637ca93a40
|
data/lib/restful/base.rb
CHANGED
@@ -343,9 +343,12 @@ module Restful
|
|
343
343
|
|
344
344
|
setup_actions actions unless actions == :all
|
345
345
|
|
346
|
-
|
347
|
-
:
|
348
|
-
|
346
|
+
if respond_to?(:helper_method)
|
347
|
+
helper_method :collection, :resource, :resource_class,
|
348
|
+
:edit_resource_path, :edit_resource_url, :new_resource_path,
|
349
|
+
:new_resource_url, :collection_path, :collection_url
|
350
|
+
|
351
|
+
end
|
349
352
|
end
|
350
353
|
|
351
354
|
protected
|
data/lib/restful/version.rb
CHANGED
@@ -4,14 +4,14 @@ describe BlocksController do
|
|
4
4
|
let(:valid_params) { { document: { name: 'Sample' } } }
|
5
5
|
|
6
6
|
it 'has one response block' do
|
7
|
-
post
|
7
|
+
post "/blocks", params: valid_params
|
8
8
|
|
9
9
|
must_redirect_to root_path
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'has two response blocks with success' do
|
13
13
|
params = valid_params.merge id: 100
|
14
|
-
post
|
14
|
+
post "/blocks", params: params
|
15
15
|
|
16
16
|
must_redirect_to root_path
|
17
17
|
end
|
@@ -21,8 +21,8 @@ describe BlocksController do
|
|
21
21
|
p[:document][:name] = ''
|
22
22
|
end
|
23
23
|
|
24
|
-
post
|
24
|
+
post "/blocks", params: params
|
25
25
|
|
26
|
-
|
26
|
+
must_respond_with :success
|
27
27
|
end
|
28
28
|
end
|
@@ -5,7 +5,7 @@ describe CustomNoticesController do
|
|
5
5
|
|
6
6
|
context 'flash messages' do
|
7
7
|
it 'has a notice' do
|
8
|
-
post
|
8
|
+
post "/custom_notices", params: valid_params
|
9
9
|
|
10
10
|
flash[:notice].must_equal 'A new document was created'
|
11
11
|
must_redirect_to root_path
|
@@ -13,7 +13,7 @@ describe CustomNoticesController do
|
|
13
13
|
|
14
14
|
it 'has an alert' do
|
15
15
|
params = valid_params.merge id: 100
|
16
|
-
put
|
16
|
+
put "/custom_notices/100", params: params
|
17
17
|
|
18
18
|
flash[:alert].must_equal 'There are some errors'
|
19
19
|
must_redirect_to root_path
|
data/test/dummy/bin/rails
CHANGED
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
require 'fileutils'
|
4
|
+
include FileUtils
|
5
|
+
|
6
|
+
# path to your application root.
|
7
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
8
|
+
|
9
|
+
def system!(*args)
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
11
|
+
end
|
12
|
+
|
13
|
+
chdir APP_ROOT do
|
14
|
+
# This script is a starting point to setup your application.
|
15
|
+
# Add necessary setup steps to this file.
|
16
|
+
|
17
|
+
puts '== Installing dependencies =='
|
18
|
+
system! 'gem install bundler --conservative'
|
19
|
+
system('bundle check') || system!('bundle install')
|
20
|
+
|
21
|
+
# puts "\n== Copying sample files =="
|
22
|
+
# unless File.exist?('config/database.yml')
|
23
|
+
# cp 'config/database.yml.sample', 'config/database.yml'
|
24
|
+
# end
|
25
|
+
|
26
|
+
puts "\n== Preparing database =="
|
27
|
+
system! 'bin/rails db:setup'
|
28
|
+
|
29
|
+
puts "\n== Removing old logs and tempfiles =="
|
30
|
+
system! 'bin/rails log:clear tmp:clear'
|
31
|
+
|
32
|
+
puts "\n== Restarting application server =="
|
33
|
+
system! 'bin/rails restart'
|
34
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
require 'fileutils'
|
4
|
+
include FileUtils
|
5
|
+
|
6
|
+
# path to your application root.
|
7
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
8
|
+
|
9
|
+
def system!(*args)
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
11
|
+
end
|
12
|
+
|
13
|
+
chdir APP_ROOT do
|
14
|
+
# This script is a way to update your development environment automatically.
|
15
|
+
# Add necessary update steps to this file.
|
16
|
+
|
17
|
+
puts '== Installing dependencies =='
|
18
|
+
system! 'gem install bundler --conservative'
|
19
|
+
system('bundle check') || system!('bundle install')
|
20
|
+
|
21
|
+
puts "\n== Updating database =="
|
22
|
+
system! 'bin/rails db:migrate'
|
23
|
+
|
24
|
+
puts "\n== Removing old logs and tempfiles =="
|
25
|
+
system! 'bin/rails log:clear tmp:clear'
|
26
|
+
|
27
|
+
puts "\n== Restarting application server =="
|
28
|
+
system! 'bin/rails restart'
|
29
|
+
end
|
@@ -1,14 +1,11 @@
|
|
1
|
-
|
1
|
+
require_relative 'boot'
|
2
2
|
|
3
|
-
|
4
|
-
require "active_record/railtie"
|
5
|
-
require "action_controller/railtie"
|
6
|
-
require 'rake/testtask'
|
7
|
-
require "action_mailer/railtie"
|
8
|
-
require "sprockets/railtie"
|
9
|
-
require "minitest/rails/railtie"
|
3
|
+
require 'rails/all'
|
10
4
|
|
5
|
+
# Require the gems listed in Gemfile, including any gems
|
6
|
+
# you've limited to :test, :development, or :production.
|
11
7
|
Bundler.require(*Rails.groups)
|
8
|
+
|
12
9
|
require "restful"
|
13
10
|
|
14
11
|
module Dummy
|
@@ -16,14 +13,5 @@ module Dummy
|
|
16
13
|
# Settings in config/environments/* take precedence over those specified here.
|
17
14
|
# Application configuration should go into files in config/initializers
|
18
15
|
# -- all .rb files in that directory are automatically loaded.
|
19
|
-
|
20
|
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
21
|
-
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
22
|
-
# config.time_zone = 'Central Time (US & Canada)'
|
23
|
-
|
24
|
-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
25
|
-
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
26
|
-
# config.i18n.default_locale = :de
|
27
16
|
end
|
28
17
|
end
|
29
|
-
|
data/test/dummy/config/boot.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
|
2
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
|
1
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
3
2
|
|
4
|
-
require 'bundler/setup'
|
5
|
-
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
|
3
|
+
require 'bundler/setup' # Set up gems listed in the Gemfile.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
Rails.application.configure do
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# In the development environment your application's code is reloaded on
|
@@ -9,21 +9,46 @@ Dummy::Application.configure do
|
|
9
9
|
# Do not eager load code on boot.
|
10
10
|
config.eager_load = false
|
11
11
|
|
12
|
-
# Show full error reports
|
13
|
-
config.consider_all_requests_local
|
14
|
-
|
12
|
+
# Show full error reports.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
|
15
|
+
# Enable/disable caching. By default caching is disabled.
|
16
|
+
if Rails.root.join('tmp/caching-dev.txt').exist?
|
17
|
+
config.action_controller.perform_caching = true
|
18
|
+
|
19
|
+
config.cache_store = :memory_store
|
20
|
+
config.public_file_server.headers = {
|
21
|
+
'Cache-Control' => 'public, max-age=172800'
|
22
|
+
}
|
23
|
+
else
|
24
|
+
config.action_controller.perform_caching = false
|
25
|
+
|
26
|
+
config.cache_store = :null_store
|
27
|
+
end
|
15
28
|
|
16
29
|
# Don't care if the mailer can't send.
|
17
30
|
config.action_mailer.raise_delivery_errors = false
|
18
31
|
|
32
|
+
config.action_mailer.perform_caching = false
|
33
|
+
|
19
34
|
# Print deprecation notices to the Rails logger.
|
20
35
|
config.active_support.deprecation = :log
|
21
36
|
|
22
|
-
# Raise an error on page load if there are pending migrations
|
37
|
+
# Raise an error on page load if there are pending migrations.
|
23
38
|
config.active_record.migration_error = :page_load
|
24
39
|
|
25
40
|
# Debug mode disables concatenation and preprocessing of assets.
|
26
41
|
# This option may cause significant delays in view rendering with a large
|
27
42
|
# number of complex assets.
|
28
43
|
config.assets.debug = true
|
44
|
+
|
45
|
+
# Suppress logger output for asset requests.
|
46
|
+
config.assets.quiet = true
|
47
|
+
|
48
|
+
# Raises error for missing translations
|
49
|
+
# config.action_view.raise_on_missing_translations = true
|
50
|
+
|
51
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
52
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
53
|
+
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
29
54
|
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
|
1
|
+
Rails.application.configure do
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# Code is not reloaded between requests.
|
5
5
|
config.cache_classes = true
|
6
6
|
|
7
7
|
# Eager load code on boot. This eager loads most of Rails and
|
8
|
-
# your application in memory, allowing both
|
8
|
+
# your application in memory, allowing both threaded web servers
|
9
9
|
# and those relying on copy on write to perform better.
|
10
10
|
# Rake tasks automatically ignore this option for performance.
|
11
11
|
config.eager_load = true
|
@@ -14,13 +14,9 @@ Dummy::Application.configure do
|
|
14
14
|
config.consider_all_requests_local = false
|
15
15
|
config.action_controller.perform_caching = true
|
16
16
|
|
17
|
-
#
|
18
|
-
#
|
19
|
-
|
20
|
-
# config.action_dispatch.rack_cache = true
|
21
|
-
|
22
|
-
# Disable Rails's static asset server (Apache or nginx will already do this).
|
23
|
-
config.serve_static_assets = false
|
17
|
+
# Disable serving static files from the `/public` folder by default since
|
18
|
+
# Apache or NGINX already handles this.
|
19
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
24
20
|
|
25
21
|
# Compress JavaScripts and CSS.
|
26
22
|
config.assets.js_compressor = :uglifier
|
@@ -29,52 +25,62 @@ Dummy::Application.configure do
|
|
29
25
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
30
26
|
config.assets.compile = false
|
31
27
|
|
32
|
-
#
|
33
|
-
config.assets.digest = true
|
28
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
34
29
|
|
35
|
-
#
|
36
|
-
config.
|
30
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
31
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
37
32
|
|
38
33
|
# Specifies the header that your server uses for sending files.
|
39
|
-
# config.action_dispatch.x_sendfile_header =
|
40
|
-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for
|
34
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
35
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
36
|
+
|
37
|
+
# Mount Action Cable outside main process or domain
|
38
|
+
# config.action_cable.mount_path = nil
|
39
|
+
# config.action_cable.url = 'wss://example.com/cable'
|
40
|
+
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
41
41
|
|
42
42
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
43
43
|
# config.force_ssl = true
|
44
44
|
|
45
|
-
#
|
46
|
-
|
45
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
46
|
+
# when problems arise.
|
47
|
+
config.log_level = :debug
|
47
48
|
|
48
49
|
# Prepend all log lines with the following tags.
|
49
|
-
|
50
|
-
|
51
|
-
# Use a different logger for distributed setups.
|
52
|
-
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
50
|
+
config.log_tags = [ :request_id ]
|
53
51
|
|
54
52
|
# Use a different cache store in production.
|
55
53
|
# config.cache_store = :mem_cache_store
|
56
54
|
|
57
|
-
#
|
58
|
-
# config.
|
59
|
-
|
60
|
-
|
61
|
-
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
62
|
-
# config.assets.precompile += %w( search.js )
|
55
|
+
# Use a real queuing backend for Active Job (and separate queues per environment)
|
56
|
+
# config.active_job.queue_adapter = :resque
|
57
|
+
# config.active_job.queue_name_prefix = "dummy_#{Rails.env}"
|
58
|
+
config.action_mailer.perform_caching = false
|
63
59
|
|
64
60
|
# Ignore bad email addresses and do not raise email delivery errors.
|
65
61
|
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
66
62
|
# config.action_mailer.raise_delivery_errors = false
|
67
63
|
|
68
64
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
69
|
-
# the I18n.default_locale when a translation
|
65
|
+
# the I18n.default_locale when a translation cannot be found).
|
70
66
|
config.i18n.fallbacks = true
|
71
67
|
|
72
68
|
# Send deprecation notices to registered listeners.
|
73
69
|
config.active_support.deprecation = :notify
|
74
70
|
|
75
|
-
# Disable automatic flushing of the log to improve performance.
|
76
|
-
# config.autoflush_log = false
|
77
|
-
|
78
71
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
79
72
|
config.log_formatter = ::Logger::Formatter.new
|
73
|
+
|
74
|
+
# Use a different logger for distributed setups.
|
75
|
+
# require 'syslog/logger'
|
76
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
77
|
+
|
78
|
+
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
79
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
80
|
+
logger.formatter = config.log_formatter
|
81
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
82
|
+
end
|
83
|
+
|
84
|
+
# Do not dump schema after migrations.
|
85
|
+
config.active_record.dump_schema_after_migration = false
|
80
86
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
Rails.application.configure do
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
@@ -12,9 +12,11 @@ Dummy::Application.configure do
|
|
12
12
|
# preloads Rails for running tests, you may have to set it to true.
|
13
13
|
config.eager_load = false
|
14
14
|
|
15
|
-
# Configure
|
16
|
-
config.
|
17
|
-
config.
|
15
|
+
# Configure public file server for tests with Cache-Control for performance.
|
16
|
+
config.public_file_server.enabled = true
|
17
|
+
config.public_file_server.headers = {
|
18
|
+
'Cache-Control' => 'public, max-age=3600'
|
19
|
+
}
|
18
20
|
|
19
21
|
# Show full error reports and disable caching.
|
20
22
|
config.consider_all_requests_local = true
|
@@ -25,6 +27,7 @@ Dummy::Application.configure do
|
|
25
27
|
|
26
28
|
# Disable request forgery protection in test environment.
|
27
29
|
config.action_controller.allow_forgery_protection = false
|
30
|
+
config.action_mailer.perform_caching = false
|
28
31
|
|
29
32
|
# Tell Action Mailer not to deliver emails to the real world.
|
30
33
|
# The :test delivery method accumulates sent emails in the
|
@@ -33,4 +36,7 @@ Dummy::Application.configure do
|
|
33
36
|
|
34
37
|
# Print deprecation notices to the stderr.
|
35
38
|
config.active_support.deprecation = :stderr
|
39
|
+
|
40
|
+
# Raises error for missing translations
|
41
|
+
# config.action_view.raise_on_missing_translations = true
|
36
42
|
end
|