-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run rails app:update and go through new framework defaults
- Loading branch information
Showing
11 changed files
with
90 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env ruby | ||
APP_PATH = File.expand_path('../config/application', __dir__) | ||
require_relative '../config/boot' | ||
require 'rails/commands' | ||
APP_PATH = File.expand_path("../config/application", __dir__) | ||
require_relative "../config/boot" | ||
require "rails/commands" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env ruby | ||
require_relative '../config/boot' | ||
require 'rake' | ||
require_relative "../config/boot" | ||
require "rake" | ||
Rake.application.run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
#!/usr/bin/env ruby | ||
require 'fileutils' | ||
require "fileutils" | ||
|
||
# path to your application root. | ||
APP_ROOT = File.expand_path('..', __dir__) | ||
APP_ROOT = File.expand_path("..", __dir__) | ||
|
||
def system!(*args) | ||
system(*args) || abort("\n== Command #{args} failed ==") | ||
system(*args, exception: true) | ||
end | ||
|
||
FileUtils.chdir APP_ROOT do | ||
# This script is a way to set up or update your development environment automatically. | ||
# This script is idempotent, so that you can run it at any time and get an expectable outcome. | ||
# Add necessary setup steps to this file. | ||
|
||
puts '== Installing dependencies ==' | ||
system! 'gem install bundler --conservative' | ||
system('bundle check') || system!('bundle install') | ||
puts "== Installing dependencies ==" | ||
system! "gem install bundler --conservative" | ||
system("bundle check") || system!("bundle install") | ||
|
||
# puts "\n== Copying sample files ==" | ||
# unless File.exist?("config/database.yml") | ||
# FileUtils.cp "config/database.yml.sample", "config/database.yml" | ||
# end | ||
|
||
puts "\n== Preparing database ==" | ||
system! 'bin/rails db:prepare' | ||
system! "bin/rails db:prepare" | ||
|
||
puts "\n== Removing old logs and tempfiles ==" | ||
system! 'bin/rails log:clear tmp:clear' | ||
system! "bin/rails log:clear tmp:clear" | ||
|
||
puts "\n== Restarting application server ==" | ||
system! 'bin/rails restart' | ||
system! "bin/rails restart" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
Rails.application.config.middleware.insert_before 0, Rack::Cors do | ||
allow do | ||
origins '*' | ||
resource '*', | ||
headers: :any, | ||
methods: %i[get head] | ||
end | ||
end | ||
# Be sure to restart your server when you modify this file. | ||
|
||
# Avoid CORS issues when API is called from the frontend app. | ||
# Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin Ajax requests. | ||
|
||
# Read more: https://github.com/cyu/rack-cors | ||
|
||
# Rails.application.config.middleware.insert_before 0, Rack::Cors do | ||
# allow do | ||
# origins "example.com" | ||
# | ||
# resource "*", | ||
# headers: :any, | ||
# methods: [:get, :post, :put, :patch, :delete, :options, :head] | ||
# end | ||
# end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# Be sure to restart your server when you modify this file. | ||
|
||
# Configure parameters to be filtered from the log file. Use this to limit dissemination of | ||
# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported | ||
# notations and behaviors. | ||
# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. | ||
# Use this to limit dissemination of sensitive information. | ||
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. | ||
Rails.application.config.filter_parameters += %i[ | ||
passw secret token _key crypt salt certificate otp ssn | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
# Be sure to restart your server when you modify this file. | ||
|
||
# Define an application-wide HTTP permissions policy. For further | ||
# information see https://developers.google.com/web/updates/2018/06/feature-policy | ||
# | ||
# Rails.application.config.permissions_policy do |f| | ||
# f.camera :none | ||
# f.gyroscope :none | ||
# f.microphone :none | ||
# f.usb :none | ||
# f.fullscreen :self | ||
# f.payment :self, "https://secure.example.com" | ||
# information see: https://developers.google.com/web/updates/2018/06/feature-policy | ||
|
||
# Rails.application.config.permissions_policy do |policy| | ||
# policy.camera :none | ||
# policy.gyroscope :none | ||
# policy.microphone :none | ||
# policy.usb :none | ||
# policy.fullscreen :self | ||
# policy.payment :self, "https://secure.example.com" | ||
# end |