abizvn-general 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/serializers/abizvn/general/general_setting_lite_serializer.rb +9 -9
- data/app/services/abizvn/general/general_setting_service.rb +11 -11
- data/lib/abizvn/general/version.rb +5 -5
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +3 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +4 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/jobs/application_job.rb +7 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +22 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/app/views/pwa/manifest.json.erb +22 -0
- data/spec/dummy/app/views/pwa/service-worker.js +26 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/rubocop +8 -0
- data/spec/dummy/bin/setup +37 -0
- data/spec/dummy/config/application.rb +42 -0
- data/spec/dummy/config/boot.rb +3 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +32 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +81 -0
- data/spec/dummy/config/environments/production.rb +105 -0
- data/spec/dummy/config/environments/test.rb +67 -0
- data/spec/dummy/config/initializers/assets.rb +12 -0
- data/spec/dummy/config/initializers/content_security_policy.rb +25 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +8 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/new_framework_defaults_7_2.rb +70 -0
- data/spec/dummy/config/initializers/permissions_policy.rb +13 -0
- data/spec/dummy/config/locales/en.yml +31 -0
- data/spec/dummy/config/puma.rb +34 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/storage.yml +34 -0
- data/spec/dummy/config.ru +6 -0
- data/spec/dummy/db/migrate/20250312042100_add_service_name_to_active_storage_blobs.active_storage.rb +22 -0
- data/spec/dummy/db/migrate/20250312042101_create_active_storage_variant_records.active_storage.rb +27 -0
- data/spec/dummy/db/migrate/20250312042102_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb +8 -0
- data/spec/dummy/db/schema.rb +24 -0
- data/spec/dummy/log/development.log +168 -0
- data/spec/dummy/log/test.log +818 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/406-unsupported-browser.html +66 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/icon.png +0 -0
- data/spec/dummy/public/icon.svg +3 -0
- data/spec/dummy/public/robots.txt +1 -0
- data/spec/dummy/storage/development.sqlite3 +0 -0
- data/spec/dummy/storage/test.sqlite3 +0 -0
- data/spec/dummy/tmp/local_secret.txt +1 -0
- data/spec/factories/abizvn/general/general_settings.rb +9 -0
- data/spec/lib/general_spec.rb +7 -0
- data/spec/models/abizvn/general/general_setting_spec.rb +47 -0
- data/spec/rails_helper.rb +84 -0
- data/spec/serializers/abizvn/general/general_setting_lite_serializer_spec.rb +14 -0
- data/spec/services/abizvn/general/general_setting_service_spec.rb +18 -0
- data/spec/spec_helper.rb +94 -0
- data/spec/support/general_validation_helpers.rb +21 -0
- metadata +64 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aba10f08abe9ca5ae9a3ec57bd6067351a3d784a1db8b1324849b734d10f2114
|
4
|
+
data.tar.gz: ce09f2cb73bedcd51addf79c7e80eae02f944e48b8339545c9831de80a1d5ae8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c1d04be71d14d95924df9fa03aa45d4ab74eb34faf883511c7f4fd182dd8d6908d577b0e49dfdb3f425e23e9553bebb6a5192072ec4d1e7a108641250649602
|
7
|
+
data.tar.gz: f839ae88d2d5c994bb7a0b18f511894229cdcee3904cab07bd4cf1747a964c81129811216a40ad7d173ea49ffa14d0e820d4d984ac96defeff7ecffbdc152c16
|
@@ -1,9 +1,9 @@
|
|
1
|
-
module Abizvn
|
2
|
-
module General
|
3
|
-
class GeneralSettingLiteSerializer
|
4
|
-
include JSONAPI::Serializer
|
5
|
-
|
6
|
-
attributes :id, :code, :value
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
1
|
+
module Abizvn
|
2
|
+
module General
|
3
|
+
class GeneralSettingLiteSerializer
|
4
|
+
include JSONAPI::Serializer
|
5
|
+
|
6
|
+
attributes :id, :code, :value
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
module Abizvn
|
2
|
-
module General
|
3
|
-
class GeneralSettingService
|
4
|
-
class << self
|
5
|
-
def find_by_group(group)
|
6
|
-
GeneralSetting.activated.where(group: group).ordered
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
1
|
+
module Abizvn
|
2
|
+
module General
|
3
|
+
class GeneralSettingService
|
4
|
+
class << self
|
5
|
+
def find_by_group(group)
|
6
|
+
GeneralSetting.activated.where(group: group).ordered
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module Abizvn
|
2
|
-
module General
|
3
|
-
VERSION = "0.2.
|
4
|
-
end
|
5
|
-
end
|
1
|
+
module Abizvn
|
2
|
+
module General
|
3
|
+
VERSION = "0.2.1"
|
4
|
+
end
|
5
|
+
end
|
data/spec/dummy/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,7 @@
|
|
1
|
+
class ApplicationJob < ActiveJob::Base
|
2
|
+
# Automatically retry jobs that encountered a deadlock
|
3
|
+
# retry_on ActiveRecord::Deadlocked
|
4
|
+
|
5
|
+
# Most jobs are safe to ignore if the underlying records are no longer available
|
6
|
+
# discard_on ActiveJob::DeserializationError
|
7
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%= content_for(:title) || "Dummy" %></title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
<%= csp_meta_tag %>
|
9
|
+
|
10
|
+
<%= yield :head %>
|
11
|
+
|
12
|
+
<link rel="manifest" href="/manifest.json">
|
13
|
+
<link rel="icon" href="/icon.png" type="image/png">
|
14
|
+
<link rel="icon" href="/icon.svg" type="image/svg+xml">
|
15
|
+
<link rel="apple-touch-icon" href="/icon.png">
|
16
|
+
<%= stylesheet_link_tag "application" %>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<%= yield %>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"name": "Dummy",
|
3
|
+
"icons": [
|
4
|
+
{
|
5
|
+
"src": "/icon.png",
|
6
|
+
"type": "image/png",
|
7
|
+
"sizes": "512x512"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"src": "/icon.png",
|
11
|
+
"type": "image/png",
|
12
|
+
"sizes": "512x512",
|
13
|
+
"purpose": "maskable"
|
14
|
+
}
|
15
|
+
],
|
16
|
+
"start_url": "/",
|
17
|
+
"display": "standalone",
|
18
|
+
"scope": "/",
|
19
|
+
"description": "Dummy.",
|
20
|
+
"theme_color": "red",
|
21
|
+
"background_color": "red"
|
22
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
// Add a service worker for processing Web Push notifications:
|
2
|
+
//
|
3
|
+
// self.addEventListener("push", async (event) => {
|
4
|
+
// const { title, options } = await event.data.json()
|
5
|
+
// event.waitUntil(self.registration.showNotification(title, options))
|
6
|
+
// })
|
7
|
+
//
|
8
|
+
// self.addEventListener("notificationclick", function(event) {
|
9
|
+
// event.notification.close()
|
10
|
+
// event.waitUntil(
|
11
|
+
// clients.matchAll({ type: "window" }).then((clientList) => {
|
12
|
+
// for (let i = 0; i < clientList.length; i++) {
|
13
|
+
// let client = clientList[i]
|
14
|
+
// let clientPath = (new URL(client.url)).pathname
|
15
|
+
//
|
16
|
+
// if (clientPath == event.notification.data.path && "focus" in client) {
|
17
|
+
// return client.focus()
|
18
|
+
// }
|
19
|
+
// }
|
20
|
+
//
|
21
|
+
// if (clients.openWindow) {
|
22
|
+
// return clients.openWindow(event.notification.data.path)
|
23
|
+
// }
|
24
|
+
// })
|
25
|
+
// )
|
26
|
+
// })
|
data/spec/dummy/bin/rake
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "rubygems"
|
3
|
+
require "bundler/setup"
|
4
|
+
|
5
|
+
# explicit rubocop config increases performance slightly while avoiding config confusion.
|
6
|
+
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
|
7
|
+
|
8
|
+
load Gem.bin_path("rubocop", "rubocop")
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "fileutils"
|
3
|
+
|
4
|
+
APP_ROOT = File.expand_path("..", __dir__)
|
5
|
+
APP_NAME = "dummy"
|
6
|
+
|
7
|
+
def system!(*args)
|
8
|
+
system(*args, exception: true)
|
9
|
+
end
|
10
|
+
|
11
|
+
FileUtils.chdir APP_ROOT do
|
12
|
+
# This script is a way to set up or update your development environment automatically.
|
13
|
+
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
|
14
|
+
# Add necessary setup steps to this file.
|
15
|
+
|
16
|
+
puts "== Installing dependencies =="
|
17
|
+
system! "gem install bundler --conservative"
|
18
|
+
system("bundle check") || system!("bundle install")
|
19
|
+
|
20
|
+
# puts "\n== Copying sample files =="
|
21
|
+
# unless File.exist?("config/database.yml")
|
22
|
+
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
|
23
|
+
# end
|
24
|
+
|
25
|
+
puts "\n== Preparing database =="
|
26
|
+
system! "bin/rails db:prepare"
|
27
|
+
|
28
|
+
puts "\n== Removing old logs and tempfiles =="
|
29
|
+
system! "bin/rails log:clear tmp:clear"
|
30
|
+
|
31
|
+
puts "\n== Restarting application server =="
|
32
|
+
system! "bin/rails restart"
|
33
|
+
|
34
|
+
# puts "\n== Configuring puma-dev =="
|
35
|
+
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
|
36
|
+
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
|
37
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require_relative "boot"
|
2
|
+
|
3
|
+
require "rails"
|
4
|
+
# Pick the frameworks you want:
|
5
|
+
require "active_model/railtie"
|
6
|
+
require "active_job/railtie"
|
7
|
+
require "active_record/railtie"
|
8
|
+
require "active_storage/engine"
|
9
|
+
require "action_controller/railtie"
|
10
|
+
require "action_mailer/railtie"
|
11
|
+
require "action_mailbox/engine"
|
12
|
+
require "action_text/engine"
|
13
|
+
require "action_view/railtie"
|
14
|
+
require "action_cable/engine"
|
15
|
+
# require "rails/test_unit/railtie"
|
16
|
+
|
17
|
+
# Require the gems listed in Gemfile, including any gems
|
18
|
+
# you've limited to :test, :development, or :production.
|
19
|
+
Bundler.require(*Rails.groups)
|
20
|
+
|
21
|
+
module Dummy
|
22
|
+
class Application < Rails::Application
|
23
|
+
# Initialize configuration defaults for originally generated Rails version.
|
24
|
+
config.load_defaults 7.2
|
25
|
+
|
26
|
+
# Please, add to the `ignore` list any other `lib` subdirectories that do
|
27
|
+
# not contain `.rb` files, or that should not be reloaded or eager loaded.
|
28
|
+
# Common ones are `templates`, `generators`, or `middleware`, for example.
|
29
|
+
config.autoload_lib(ignore: %w[assets tasks])
|
30
|
+
|
31
|
+
# Configuration for the application, engines, and railties goes here.
|
32
|
+
#
|
33
|
+
# These settings can be overridden in specific environments using the files
|
34
|
+
# in config/environments, which are processed later.
|
35
|
+
#
|
36
|
+
# config.time_zone = "Central Time (US & Canada)"
|
37
|
+
# config.eager_load_paths << Rails.root.join("extras")
|
38
|
+
|
39
|
+
# Don't generate system test files.
|
40
|
+
config.generators.system_tests = nil
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# SQLite. Versions 3.8.0 and up are supported.
|
2
|
+
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem "sqlite3"
|
6
|
+
#
|
7
|
+
default: &default
|
8
|
+
adapter: sqlite3
|
9
|
+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
development:
|
13
|
+
<<: *default
|
14
|
+
database: storage/development.sqlite3
|
15
|
+
|
16
|
+
# Warning: The database defined as "test" will be erased and
|
17
|
+
# re-generated from your development database when you run "rake".
|
18
|
+
# Do not set this db to the same as development or production.
|
19
|
+
test:
|
20
|
+
<<: *default
|
21
|
+
database: storage/test.sqlite3
|
22
|
+
|
23
|
+
|
24
|
+
# SQLite3 write its data on the local filesystem, as such it requires
|
25
|
+
# persistent disks. If you are deploying to a managed service, you should
|
26
|
+
# make sure it provides disk persistence, as many don't.
|
27
|
+
#
|
28
|
+
# Similarly, if you deploy your application as a Docker container, you must
|
29
|
+
# ensure the database is located in a persisted volume.
|
30
|
+
production:
|
31
|
+
<<: *default
|
32
|
+
# database: path/to/persistent/storage/production.sqlite3
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require "active_support/core_ext/integer/time"
|
2
|
+
|
3
|
+
Rails.application.configure do
|
4
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
5
|
+
|
6
|
+
# In the development environment your application's code is reloaded any time
|
7
|
+
# it changes. This slows down response time but is perfect for development
|
8
|
+
# since you don't have to restart the web server when you make code changes.
|
9
|
+
config.enable_reloading = true
|
10
|
+
|
11
|
+
# Do not eager load code on boot.
|
12
|
+
config.eager_load = false
|
13
|
+
|
14
|
+
# Show full error reports.
|
15
|
+
config.consider_all_requests_local = true
|
16
|
+
|
17
|
+
# Enable server timing.
|
18
|
+
config.server_timing = true
|
19
|
+
|
20
|
+
# Enable/disable caching. By default caching is disabled.
|
21
|
+
# Run rails dev:cache to toggle caching.
|
22
|
+
if Rails.root.join("tmp/caching-dev.txt").exist?
|
23
|
+
config.action_controller.perform_caching = true
|
24
|
+
config.action_controller.enable_fragment_cache_logging = true
|
25
|
+
|
26
|
+
config.cache_store = :memory_store
|
27
|
+
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" }
|
28
|
+
else
|
29
|
+
config.action_controller.perform_caching = false
|
30
|
+
|
31
|
+
config.cache_store = :null_store
|
32
|
+
end
|
33
|
+
|
34
|
+
# Store uploaded files on the local file system (see config/storage.yml for options).
|
35
|
+
config.active_storage.service = :local
|
36
|
+
|
37
|
+
# Don't care if the mailer can't send.
|
38
|
+
config.action_mailer.raise_delivery_errors = false
|
39
|
+
|
40
|
+
# Disable caching for Action Mailer templates even if Action Controller
|
41
|
+
# caching is enabled.
|
42
|
+
config.action_mailer.perform_caching = false
|
43
|
+
|
44
|
+
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
|
45
|
+
|
46
|
+
# Print deprecation notices to the Rails logger.
|
47
|
+
config.active_support.deprecation = :log
|
48
|
+
|
49
|
+
# Raise exceptions for disallowed deprecations.
|
50
|
+
config.active_support.disallowed_deprecation = :raise
|
51
|
+
|
52
|
+
# Tell Active Support which deprecation messages to disallow.
|
53
|
+
config.active_support.disallowed_deprecation_warnings = []
|
54
|
+
|
55
|
+
# Raise an error on page load if there are pending migrations.
|
56
|
+
config.active_record.migration_error = :page_load
|
57
|
+
|
58
|
+
# Highlight code that triggered database queries in logs.
|
59
|
+
config.active_record.verbose_query_logs = true
|
60
|
+
|
61
|
+
# Highlight code that enqueued background job in logs.
|
62
|
+
config.active_job.verbose_enqueue_logs = true
|
63
|
+
|
64
|
+
# Suppress logger output for asset requests.
|
65
|
+
config.assets.quiet = true
|
66
|
+
|
67
|
+
# Raises error for missing translations.
|
68
|
+
# config.i18n.raise_on_missing_translations = true
|
69
|
+
|
70
|
+
# Annotate rendered view with file names.
|
71
|
+
config.action_view.annotate_rendered_view_with_filenames = true
|
72
|
+
|
73
|
+
# Uncomment if you wish to allow Action Cable access from any origin.
|
74
|
+
# config.action_cable.disable_request_forgery_protection = true
|
75
|
+
|
76
|
+
# Raise error when a before_action's only/except options reference missing actions.
|
77
|
+
config.action_controller.raise_on_missing_callback_actions = true
|
78
|
+
|
79
|
+
# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
|
80
|
+
# config.generators.apply_rubocop_autocorrect_after_generate!
|
81
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
require "active_support/core_ext/integer/time"
|
2
|
+
|
3
|
+
Rails.application.configure do
|
4
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
5
|
+
|
6
|
+
# Code is not reloaded between requests.
|
7
|
+
config.enable_reloading = false
|
8
|
+
|
9
|
+
# Eager load code on boot. This eager loads most of Rails and
|
10
|
+
# your application in memory, allowing both threaded web servers
|
11
|
+
# and those relying on copy on write to perform better.
|
12
|
+
# Rake tasks automatically ignore this option for performance.
|
13
|
+
config.eager_load = true
|
14
|
+
|
15
|
+
# Full error reports are disabled and caching is turned on.
|
16
|
+
config.consider_all_requests_local = false
|
17
|
+
config.action_controller.perform_caching = true
|
18
|
+
|
19
|
+
# Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
|
20
|
+
# key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
|
21
|
+
# config.require_master_key = true
|
22
|
+
|
23
|
+
# Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
|
24
|
+
# config.public_file_server.enabled = false
|
25
|
+
|
26
|
+
# Compress CSS using a preprocessor.
|
27
|
+
# config.assets.css_compressor = :sass
|
28
|
+
|
29
|
+
# Do not fall back to assets pipeline if a precompiled asset is missed.
|
30
|
+
config.assets.compile = false
|
31
|
+
|
32
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
33
|
+
# config.asset_host = "http://assets.example.com"
|
34
|
+
|
35
|
+
# Specifies the header that your server uses for sending files.
|
36
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
|
37
|
+
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
|
38
|
+
|
39
|
+
# Store uploaded files on the local file system (see config/storage.yml for options).
|
40
|
+
config.active_storage.service = :local
|
41
|
+
|
42
|
+
# Mount Action Cable outside main process or domain.
|
43
|
+
# config.action_cable.mount_path = nil
|
44
|
+
# config.action_cable.url = "wss://example.com/cable"
|
45
|
+
# config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
|
46
|
+
|
47
|
+
# Assume all access to the app is happening through a SSL-terminating reverse proxy.
|
48
|
+
# Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
|
49
|
+
# config.assume_ssl = true
|
50
|
+
|
51
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
52
|
+
config.force_ssl = true
|
53
|
+
|
54
|
+
# Skip http-to-https redirect for the default health check endpoint.
|
55
|
+
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
|
56
|
+
|
57
|
+
# Log to STDOUT by default
|
58
|
+
config.logger = ActiveSupport::Logger.new(STDOUT)
|
59
|
+
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
|
60
|
+
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }
|
61
|
+
|
62
|
+
# Prepend all log lines with the following tags.
|
63
|
+
config.log_tags = [ :request_id ]
|
64
|
+
|
65
|
+
# "info" includes generic and useful information about system operation, but avoids logging too much
|
66
|
+
# information to avoid inadvertent exposure of personally identifiable information (PII). If you
|
67
|
+
# want to log everything, set the level to "debug".
|
68
|
+
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
|
69
|
+
|
70
|
+
# Use a different cache store in production.
|
71
|
+
# config.cache_store = :mem_cache_store
|
72
|
+
|
73
|
+
# Use a real queuing backend for Active Job (and separate queues per environment).
|
74
|
+
# config.active_job.queue_adapter = :resque
|
75
|
+
# config.active_job.queue_name_prefix = "dummy_production"
|
76
|
+
|
77
|
+
# Disable caching for Action Mailer templates even if Action Controller
|
78
|
+
# caching is enabled.
|
79
|
+
config.action_mailer.perform_caching = false
|
80
|
+
|
81
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
82
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
83
|
+
# config.action_mailer.raise_delivery_errors = false
|
84
|
+
|
85
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
86
|
+
# the I18n.default_locale when a translation cannot be found).
|
87
|
+
config.i18n.fallbacks = true
|
88
|
+
|
89
|
+
# Don't log any deprecations.
|
90
|
+
config.active_support.report_deprecations = false
|
91
|
+
|
92
|
+
# Do not dump schema after migrations.
|
93
|
+
config.active_record.dump_schema_after_migration = false
|
94
|
+
|
95
|
+
# Only use :id for inspections in production.
|
96
|
+
config.active_record.attributes_for_inspect = [ :id ]
|
97
|
+
|
98
|
+
# Enable DNS rebinding protection and other `Host` header attacks.
|
99
|
+
# config.hosts = [
|
100
|
+
# "example.com", # Allow requests from example.com
|
101
|
+
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
|
102
|
+
# ]
|
103
|
+
# Skip DNS rebinding protection for the default health check endpoint.
|
104
|
+
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
|
105
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require "active_support/core_ext/integer/time"
|
2
|
+
|
3
|
+
# The test environment is used exclusively to run your application's
|
4
|
+
# test suite. You never need to work with it otherwise. Remember that
|
5
|
+
# your test database is "scratch space" for the test suite and is wiped
|
6
|
+
# and recreated between test runs. Don't rely on the data there!
|
7
|
+
|
8
|
+
Rails.application.configure do
|
9
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
10
|
+
|
11
|
+
# While tests run files are not watched, reloading is not necessary.
|
12
|
+
config.enable_reloading = false
|
13
|
+
|
14
|
+
# Eager loading loads your entire application. When running a single test locally,
|
15
|
+
# this is usually not necessary, and can slow down your test suite. However, it's
|
16
|
+
# recommended that you enable it in continuous integration systems to ensure eager
|
17
|
+
# loading is working properly before deploying your code.
|
18
|
+
config.eager_load = ENV["CI"].present?
|
19
|
+
|
20
|
+
# Configure public file server for tests with Cache-Control for performance.
|
21
|
+
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" }
|
22
|
+
|
23
|
+
# Show full error reports and disable caching.
|
24
|
+
config.consider_all_requests_local = true
|
25
|
+
config.action_controller.perform_caching = false
|
26
|
+
config.cache_store = :null_store
|
27
|
+
|
28
|
+
# Render exception templates for rescuable exceptions and raise for other exceptions.
|
29
|
+
config.action_dispatch.show_exceptions = :rescuable
|
30
|
+
|
31
|
+
# Disable request forgery protection in test environment.
|
32
|
+
config.action_controller.allow_forgery_protection = false
|
33
|
+
|
34
|
+
# Store uploaded files on the local file system in a temporary directory.
|
35
|
+
config.active_storage.service = :test
|
36
|
+
|
37
|
+
# Disable caching for Action Mailer templates even if Action Controller
|
38
|
+
# caching is enabled.
|
39
|
+
config.action_mailer.perform_caching = false
|
40
|
+
|
41
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
42
|
+
# The :test delivery method accumulates sent emails in the
|
43
|
+
# ActionMailer::Base.deliveries array.
|
44
|
+
config.action_mailer.delivery_method = :test
|
45
|
+
|
46
|
+
# Unlike controllers, the mailer instance doesn't have any context about the
|
47
|
+
# incoming request so you'll need to provide the :host parameter yourself.
|
48
|
+
config.action_mailer.default_url_options = { host: "www.example.com" }
|
49
|
+
|
50
|
+
# Print deprecation notices to the stderr.
|
51
|
+
config.active_support.deprecation = :stderr
|
52
|
+
|
53
|
+
# Raise exceptions for disallowed deprecations.
|
54
|
+
config.active_support.disallowed_deprecation = :raise
|
55
|
+
|
56
|
+
# Tell Active Support which deprecation messages to disallow.
|
57
|
+
config.active_support.disallowed_deprecation_warnings = []
|
58
|
+
|
59
|
+
# Raises error for missing translations.
|
60
|
+
# config.i18n.raise_on_missing_translations = true
|
61
|
+
|
62
|
+
# Annotate rendered view with file names.
|
63
|
+
# config.action_view.annotate_rendered_view_with_filenames = true
|
64
|
+
|
65
|
+
# Raise error when a before_action's only/except options reference missing actions.
|
66
|
+
config.action_controller.raise_on_missing_callback_actions = true
|
67
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Version of your assets, change this if you want to expire all your assets.
|
4
|
+
Rails.application.config.assets.version = "1.0"
|
5
|
+
|
6
|
+
# Add additional assets to the asset load path.
|
7
|
+
# Rails.application.config.assets.paths << Emoji.images_path
|
8
|
+
|
9
|
+
# Precompile additional assets.
|
10
|
+
# application.js, application.css, and all non-JS/CSS in the app/assets
|
11
|
+
# folder are already added.
|
12
|
+
# Rails.application.config.assets.precompile += %w[ admin.js admin.css ]
|