simple_calendar 3.0.3 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simple_calendar/version.rb +1 -1
- metadata +8 -97
- data/.github/FUNDING.yml +0 -12
- data/.github/workflows/ci.yml +0 -45
- data/.github/workflows/publish_gem.yml +0 -22
- data/.gitignore +0 -10
- data/.rspec +0 -2
- data/.standard.yml +0 -1
- data/Appraisals +0 -15
- data/CHANGELOG.md +0 -39
- data/Gemfile +0 -11
- data/Gemfile.lock +0 -258
- data/LICENSE.txt +0 -22
- data/bin/console +0 -8
- data/bin/rails +0 -16
- data/bin/setup +0 -5
- data/gemfiles/rails_6_1.gemfile +0 -12
- data/gemfiles/rails_6_1.gemfile.lock +0 -234
- data/gemfiles/rails_7_0.gemfile +0 -12
- data/gemfiles/rails_7_0.gemfile.lock +0 -231
- data/gemfiles/rails_7_1.gemfile +0 -12
- data/gemfiles/rails_7_1.gemfile.lock +0 -264
- data/gemfiles/rails_main.gemfile +0 -12
- data/gemfiles/rails_main.gemfile.lock +0 -263
- data/simple_calendar.gemspec +0 -20
- data/test/calendars/calendar_test.rb +0 -161
- data/test/calendars/month_calendar_test.rb +0 -16
- data/test/dummy/Rakefile +0 -6
- data/test/dummy/app/assets/config/manifest.js +0 -1
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/stylesheets/application.css +0 -1
- data/test/dummy/app/calendars/business_week_calendar.rb +0 -9
- data/test/dummy/app/channels/application_cable/channel.rb +0 -4
- data/test/dummy/app/channels/application_cable/connection.rb +0 -4
- data/test/dummy/app/controllers/application_controller.rb +0 -2
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/controllers/meetings_controller.rb +0 -63
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/helpers/meetings_helper.rb +0 -2
- data/test/dummy/app/jobs/application_job.rb +0 -7
- data/test/dummy/app/mailers/application_mailer.rb +0 -4
- data/test/dummy/app/models/application_record.rb +0 -7
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/models/meeting.rb +0 -2
- data/test/dummy/app/views/layouts/application.html.erb +0 -15
- data/test/dummy/app/views/layouts/mailer.html.erb +0 -13
- data/test/dummy/app/views/layouts/mailer.text.erb +0 -1
- data/test/dummy/app/views/meetings/_business_week_calendar.html.erb +0 -33
- data/test/dummy/app/views/meetings/_form.html.erb +0 -32
- data/test/dummy/app/views/meetings/_meeting.html.erb +0 -17
- data/test/dummy/app/views/meetings/business_week.html.erb +0 -24
- data/test/dummy/app/views/meetings/edit.html.erb +0 -10
- data/test/dummy/app/views/meetings/index.html.erb +0 -24
- data/test/dummy/app/views/meetings/new.html.erb +0 -9
- data/test/dummy/app/views/meetings/show.html.erb +0 -10
- data/test/dummy/bin/rails +0 -4
- data/test/dummy/bin/rake +0 -4
- data/test/dummy/bin/setup +0 -33
- data/test/dummy/config/application.rb +0 -22
- data/test/dummy/config/boot.rb +0 -5
- data/test/dummy/config/cable.yml +0 -10
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -67
- data/test/dummy/config/environments/production.rb +0 -87
- data/test/dummy/config/environments/test.rb +0 -60
- data/test/dummy/config/initializers/content_security_policy.rb +0 -25
- data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -8
- data/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/dummy/config/initializers/permissions_policy.rb +0 -11
- data/test/dummy/config/locales/en.yml +0 -33
- data/test/dummy/config/puma.rb +0 -43
- data/test/dummy/config/routes.rb +0 -11
- data/test/dummy/config/storage.yml +0 -34
- data/test/dummy/config.ru +0 -6
- data/test/dummy/db/migrate/20220930184313_create_meetings.rb +0 -11
- data/test/dummy/db/schema.rb +0 -21
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/public/404.html +0 -67
- data/test/dummy/public/422.html +0 -67
- data/test/dummy/public/500.html +0 -66
- data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/test/dummy/public/apple-touch-icon.png +0 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/storage/.keep +0 -0
- data/test/fixtures/meetings.yml +0 -36
- data/test/integrations/custom_calendar_test.rb +0 -33
- data/test/integrations/month_calendar_test.rb +0 -58
- data/test/simple_calendar_test.rb +0 -7
- data/test/test_helper.rb +0 -17
- /data/app/assets/stylesheets/{simple_calendar.scss → simple_calendar.css} +0 -0
@@ -1,16 +0,0 @@
|
|
1
|
-
require "test_helper"
|
2
|
-
|
3
|
-
class MonthCalendarTest < ActionView::TestCase
|
4
|
-
test "date_range returns a full calendar month" do
|
5
|
-
today = Date.today
|
6
|
-
calendar = SimpleCalendar::MonthCalendar.new(view, start_date: today)
|
7
|
-
assert calendar.date_range.min <= today.beginning_of_month
|
8
|
-
assert calendar.date_range.max >= today.end_of_month
|
9
|
-
end
|
10
|
-
|
11
|
-
test "date_range returns the days of next and previous months on the edges of the calendar" do
|
12
|
-
calendar = SimpleCalendar::MonthCalendar.new(view, start_date: Date.new(2018, 8, 1))
|
13
|
-
assert_equal Date.new(2018, 7, 30), calendar.date_range.first
|
14
|
-
assert_equal Date.new(2018, 9, 2), calendar.date_range.last
|
15
|
-
end
|
16
|
-
end
|
data/test/dummy/Rakefile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
//= link_directory ../stylesheets
|
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
/* Application styles */
|
File without changes
|
@@ -1,63 +0,0 @@
|
|
1
|
-
class MeetingsController < ApplicationController
|
2
|
-
before_action :set_meeting, only: %i[show edit update destroy]
|
3
|
-
|
4
|
-
# GET /meetings
|
5
|
-
def index
|
6
|
-
@meetings = Meeting.all
|
7
|
-
end
|
8
|
-
|
9
|
-
def business_week
|
10
|
-
@meetings = Meeting.all
|
11
|
-
end
|
12
|
-
|
13
|
-
# GET /meetings/1
|
14
|
-
def show
|
15
|
-
end
|
16
|
-
|
17
|
-
# GET /meetings/new
|
18
|
-
def new
|
19
|
-
@meeting = Meeting.new
|
20
|
-
end
|
21
|
-
|
22
|
-
# GET /meetings/1/edit
|
23
|
-
def edit
|
24
|
-
end
|
25
|
-
|
26
|
-
# POST /meetings
|
27
|
-
def create
|
28
|
-
@meeting = Meeting.new(meeting_params)
|
29
|
-
|
30
|
-
if @meeting.save
|
31
|
-
redirect_to @meeting, notice: "Meeting was successfully created."
|
32
|
-
else
|
33
|
-
render :new, status: :unprocessable_entity
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
# PATCH/PUT /meetings/1
|
38
|
-
def update
|
39
|
-
if @meeting.update(meeting_params)
|
40
|
-
redirect_to @meeting, notice: "Meeting was successfully updated."
|
41
|
-
else
|
42
|
-
render :edit, status: :unprocessable_entity
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
# DELETE /meetings/1
|
47
|
-
def destroy
|
48
|
-
@meeting.destroy
|
49
|
-
redirect_to meetings_url, notice: "Meeting was successfully destroyed."
|
50
|
-
end
|
51
|
-
|
52
|
-
private
|
53
|
-
|
54
|
-
# Use callbacks to share common setup or constraints between actions.
|
55
|
-
def set_meeting
|
56
|
-
@meeting = Meeting.find(params[:id])
|
57
|
-
end
|
58
|
-
|
59
|
-
# Only allow a list of trusted parameters through.
|
60
|
-
def meeting_params
|
61
|
-
params.require(:meeting).permit(:name, :start_time, :end_time)
|
62
|
-
end
|
63
|
-
end
|
@@ -1,7 +0,0 @@
|
|
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
|
File without changes
|
@@ -1,15 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Dummy</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<%= csrf_meta_tags %>
|
7
|
-
<%= csp_meta_tag %>
|
8
|
-
|
9
|
-
<%= stylesheet_link_tag "application" %>
|
10
|
-
</head>
|
11
|
-
|
12
|
-
<body>
|
13
|
-
<%= yield %>
|
14
|
-
</body>
|
15
|
-
</html>
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= yield %>
|
@@ -1,33 +0,0 @@
|
|
1
|
-
<div class="simple-calendar">
|
2
|
-
<div class="calendar-heading">
|
3
|
-
<span class="calendar-title"><%= t('date.month_names')[start_date.month] %> <%= start_date.year %></span>
|
4
|
-
|
5
|
-
<nav>
|
6
|
-
<%= link_to t('simple_calendar.previous', default: 'Previous'), calendar.url_for_previous_view %>
|
7
|
-
<%= link_to t('simple_calendar.today', default: 'Today'), calendar.url_for_today_view %>
|
8
|
-
<%= link_to t('simple_calendar.next', default: 'Next'), calendar.url_for_next_view %>
|
9
|
-
</nav>
|
10
|
-
</div>
|
11
|
-
|
12
|
-
<table class="table table-striped">
|
13
|
-
<thead>
|
14
|
-
<tr>
|
15
|
-
<% date_range.slice(0, 7).each do |day| %>
|
16
|
-
<th><%= t('date.abbr_day_names')[day.wday] %></th>
|
17
|
-
<% end %>
|
18
|
-
</tr>
|
19
|
-
</thead>
|
20
|
-
|
21
|
-
<tbody>
|
22
|
-
<% date_range.each_slice(7) do |week| %>
|
23
|
-
<%= content_tag :tr, class: calendar.tr_classes_for(week) do %>
|
24
|
-
<% week.each do |day| %>
|
25
|
-
<%= content_tag :td, class: calendar.td_classes_for(day) do %>
|
26
|
-
<% instance_exec(day, calendar.sorted_events_for(day), &passed_block) %>
|
27
|
-
<% end %>
|
28
|
-
<% end %>
|
29
|
-
<% end %>
|
30
|
-
<% end %>
|
31
|
-
</tbody>
|
32
|
-
</table>
|
33
|
-
</div>
|
@@ -1,32 +0,0 @@
|
|
1
|
-
<%= form_with(model: meeting) do |form| %>
|
2
|
-
<% if meeting.errors.any? %>
|
3
|
-
<div style="color: red">
|
4
|
-
<h2><%= pluralize(meeting.errors.count, "error") %> prohibited this meeting from being saved:</h2>
|
5
|
-
|
6
|
-
<ul>
|
7
|
-
<% meeting.errors.each do |error| %>
|
8
|
-
<li><%= error.full_message %></li>
|
9
|
-
<% end %>
|
10
|
-
</ul>
|
11
|
-
</div>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<div>
|
15
|
-
<%= form.label :name, style: "display: block" %>
|
16
|
-
<%= form.text_field :name %>
|
17
|
-
</div>
|
18
|
-
|
19
|
-
<div>
|
20
|
-
<%= form.label :start_time, style: "display: block" %>
|
21
|
-
<%= form.datetime_field :start_time %>
|
22
|
-
</div>
|
23
|
-
|
24
|
-
<div>
|
25
|
-
<%= form.label :end_time, style: "display: block" %>
|
26
|
-
<%= form.datetime_field :end_time %>
|
27
|
-
</div>
|
28
|
-
|
29
|
-
<div>
|
30
|
-
<%= form.submit %>
|
31
|
-
</div>
|
32
|
-
<% end %>
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<div id="<%= dom_id meeting %>">
|
2
|
-
<p>
|
3
|
-
<strong>Name:</strong>
|
4
|
-
<%= meeting.name %>
|
5
|
-
</p>
|
6
|
-
|
7
|
-
<p>
|
8
|
-
<strong>Start time:</strong>
|
9
|
-
<%= meeting.start_time %>
|
10
|
-
</p>
|
11
|
-
|
12
|
-
<p>
|
13
|
-
<strong>End time:</strong>
|
14
|
-
<%= meeting.end_time %>
|
15
|
-
</p>
|
16
|
-
|
17
|
-
</div>
|
@@ -1,24 +0,0 @@
|
|
1
|
-
<p style="color: green"><%= notice %></p>
|
2
|
-
|
3
|
-
<h1>Meetings</h1>
|
4
|
-
<%= render BusinessWeekCalendar.new(self, events: @meetings) do |date, meetings| %>
|
5
|
-
<%= date %>
|
6
|
-
|
7
|
-
<% meetings.each do |meeting| %>
|
8
|
-
<div>
|
9
|
-
<%= meeting.name %>
|
10
|
-
</div>
|
11
|
-
<% end %>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<div id="meetings">
|
15
|
-
<% @meetings.each do |meeting| %>
|
16
|
-
<%= render meeting %>
|
17
|
-
<p>
|
18
|
-
<%= link_to "Show this meeting", meeting %>
|
19
|
-
</p>
|
20
|
-
<% end %>
|
21
|
-
</div>
|
22
|
-
|
23
|
-
<%= link_to "New meeting", new_meeting_path %>
|
24
|
-
<%= Time.current.beginning_of_month %>
|
@@ -1,24 +0,0 @@
|
|
1
|
-
<p style="color: green"><%= notice %></p>
|
2
|
-
|
3
|
-
<h1>Meetings</h1>
|
4
|
-
<%= month_calendar(events: @meetings) do |date, meetings| %>
|
5
|
-
<%= date %>
|
6
|
-
|
7
|
-
<% meetings.each do |meeting| %>
|
8
|
-
<div>
|
9
|
-
<%= meeting.name %>
|
10
|
-
</div>
|
11
|
-
<% end %>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<div id="meetings">
|
15
|
-
<% @meetings.each do |meeting| %>
|
16
|
-
<%= render meeting %>
|
17
|
-
<p>
|
18
|
-
<%= link_to "Show this meeting", meeting %>
|
19
|
-
</p>
|
20
|
-
<% end %>
|
21
|
-
</div>
|
22
|
-
|
23
|
-
<%= link_to "New meeting", new_meeting_path %>
|
24
|
-
<%= Time.current.beginning_of_month %>
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<p style="color: green"><%= notice %></p>
|
2
|
-
|
3
|
-
<%= render @meeting %>
|
4
|
-
|
5
|
-
<div>
|
6
|
-
<%= link_to "Edit this meeting", edit_meeting_path(@meeting) %> |
|
7
|
-
<%= link_to "Back to meetings", meetings_path %>
|
8
|
-
|
9
|
-
<%= button_to "Destroy this meeting", @meeting, method: :delete %>
|
10
|
-
</div>
|
data/test/dummy/bin/rails
DELETED
data/test/dummy/bin/rake
DELETED
data/test/dummy/bin/setup
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require "fileutils"
|
3
|
-
|
4
|
-
# path to your application root.
|
5
|
-
APP_ROOT = File.expand_path("..", __dir__)
|
6
|
-
|
7
|
-
def system!(*args)
|
8
|
-
system(*args) || abort("\n== Command #{args} failed ==")
|
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
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require_relative "boot"
|
2
|
-
|
3
|
-
require "rails/all"
|
4
|
-
|
5
|
-
# Require the gems listed in Gemfile, including any gems
|
6
|
-
# you've limited to :test, :development, or :production.
|
7
|
-
Bundler.require(*Rails.groups)
|
8
|
-
require "simple_calendar"
|
9
|
-
|
10
|
-
module Dummy
|
11
|
-
class Application < Rails::Application
|
12
|
-
config.load_defaults Rails::VERSION::STRING.to_f
|
13
|
-
|
14
|
-
# Configuration for the application, engines, and railties goes here.
|
15
|
-
#
|
16
|
-
# These settings can be overridden in specific environments using the files
|
17
|
-
# in config/environments, which are processed later.
|
18
|
-
#
|
19
|
-
# config.time_zone = "Central Time (US & Canada)"
|
20
|
-
# config.eager_load_paths << Rails.root.join("extras")
|
21
|
-
end
|
22
|
-
end
|
data/test/dummy/config/boot.rb
DELETED
data/test/dummy/config/cable.yml
DELETED
@@ -1,25 +0,0 @@
|
|
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: db/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: db/test.sqlite3
|
22
|
-
|
23
|
-
production:
|
24
|
-
<<: *default
|
25
|
-
database: db/production.sqlite3
|
@@ -1,67 +0,0 @@
|
|
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.cache_classes = false
|
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 = {
|
28
|
-
"Cache-Control" => "public, max-age=#{2.days.to_i}"
|
29
|
-
}
|
30
|
-
else
|
31
|
-
config.action_controller.perform_caching = false
|
32
|
-
|
33
|
-
config.cache_store = :null_store
|
34
|
-
end
|
35
|
-
|
36
|
-
# Store uploaded files on the local file system (see config/storage.yml for options).
|
37
|
-
config.active_storage.service = :local
|
38
|
-
|
39
|
-
# Don't care if the mailer can't send.
|
40
|
-
config.action_mailer.raise_delivery_errors = false
|
41
|
-
|
42
|
-
config.action_mailer.perform_caching = false
|
43
|
-
|
44
|
-
# Print deprecation notices to the Rails logger.
|
45
|
-
config.active_support.deprecation = :log
|
46
|
-
|
47
|
-
# Raise exceptions for disallowed deprecations.
|
48
|
-
config.active_support.disallowed_deprecation = :raise
|
49
|
-
|
50
|
-
# Tell Active Support which deprecation messages to disallow.
|
51
|
-
config.active_support.disallowed_deprecation_warnings = []
|
52
|
-
|
53
|
-
# Raise an error on page load if there are pending migrations.
|
54
|
-
config.active_record.migration_error = :page_load
|
55
|
-
|
56
|
-
# Highlight code that triggered database queries in logs.
|
57
|
-
config.active_record.verbose_query_logs = true
|
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
|
-
# Uncomment if you wish to allow Action Cable access from any origin.
|
66
|
-
# config.action_cable.disable_request_forgery_protection = true
|
67
|
-
end
|
@@ -1,87 +0,0 @@
|
|
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.cache_classes = true
|
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 either ENV["RAILS_MASTER_KEY"]
|
20
|
-
# or in config/master.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 the `/public` folder by default since
|
24
|
-
# Apache or NGINX already handles this.
|
25
|
-
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
|
26
|
-
|
27
|
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
28
|
-
# config.asset_host = "http://assets.example.com"
|
29
|
-
|
30
|
-
# Specifies the header that your server uses for sending files.
|
31
|
-
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
|
32
|
-
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
|
33
|
-
|
34
|
-
# Store uploaded files on the local file system (see config/storage.yml for options).
|
35
|
-
config.active_storage.service = :local
|
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
|
-
|
42
|
-
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
43
|
-
# config.force_ssl = true
|
44
|
-
|
45
|
-
# Include generic and useful information about system operation, but avoid logging too much
|
46
|
-
# information to avoid inadvertent exposure of personally identifiable information (PII).
|
47
|
-
config.log_level = :info
|
48
|
-
|
49
|
-
# Prepend all log lines with the following tags.
|
50
|
-
config.log_tags = [:request_id]
|
51
|
-
|
52
|
-
# Use a different cache store in production.
|
53
|
-
# config.cache_store = :mem_cache_store
|
54
|
-
|
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_production"
|
58
|
-
|
59
|
-
config.action_mailer.perform_caching = false
|
60
|
-
|
61
|
-
# Ignore bad email addresses and do not raise email delivery errors.
|
62
|
-
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
63
|
-
# config.action_mailer.raise_delivery_errors = false
|
64
|
-
|
65
|
-
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
66
|
-
# the I18n.default_locale when a translation cannot be found).
|
67
|
-
config.i18n.fallbacks = true
|
68
|
-
|
69
|
-
# Don't log any deprecations.
|
70
|
-
config.active_support.report_deprecations = false
|
71
|
-
|
72
|
-
# Use default logging formatter so that PID and timestamp are not suppressed.
|
73
|
-
config.log_formatter = ::Logger::Formatter.new
|
74
|
-
|
75
|
-
# Use a different logger for distributed setups.
|
76
|
-
# require "syslog/logger"
|
77
|
-
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
|
78
|
-
|
79
|
-
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
80
|
-
logger = ActiveSupport::Logger.new($stdout)
|
81
|
-
logger.formatter = config.log_formatter
|
82
|
-
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
83
|
-
end
|
84
|
-
|
85
|
-
# Do not dump schema after migrations.
|
86
|
-
config.active_record.dump_schema_after_migration = false
|
87
|
-
end
|