Some fixes
This commit is contained in:
parent
321111d094
commit
4802e0dcb0
12 changed files with 36 additions and 33 deletions
|
@ -11,6 +11,7 @@ AllCops:
|
||||||
- 'db/schema.rb'
|
- 'db/schema.rb'
|
||||||
- 'lib/tasks/cucumber.rake'
|
- 'lib/tasks/cucumber.rake'
|
||||||
- 'lib/templates/**/*'
|
- 'lib/templates/**/*'
|
||||||
|
- 'node_modules/**/*'
|
||||||
- 'script/cucumber'
|
- 'script/cucumber'
|
||||||
- 'vendor/**/*'
|
- 'vendor/**/*'
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@ services:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
|
- RAILS_WEB_CONCURRENCY=1
|
||||||
|
- RAILS_MIN_THREADS=1
|
||||||
- RAILS_MAX_THREADS=5
|
- RAILS_MAX_THREADS=5
|
||||||
- SIDEKIQ_CONCURRENCY=5
|
- SIDEKIQ_CONCURRENCY=5
|
||||||
|
|
||||||
|
|
4
Gemfile
4
Gemfile
|
@ -4,7 +4,7 @@ ruby '2.7.0'
|
||||||
|
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
git_source(:github) { |s| "https://github.com/#{s}.git" }
|
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
||||||
|
|
||||||
gem 'aws-sdk-s3', require: false
|
gem 'aws-sdk-s3', require: false
|
||||||
gem 'bcrypt', '~> 3.1'
|
gem 'bcrypt', '~> 3.1'
|
||||||
|
@ -28,7 +28,7 @@ gem 'puma', '~> 4.2'
|
||||||
gem 'pundit', '~> 2.1'
|
gem 'pundit', '~> 2.1'
|
||||||
gem 'rack', '= 2.2.0', github: 'rack/rack'
|
gem 'rack', '= 2.2.0', github: 'rack/rack'
|
||||||
gem 'rack-attack', '~> 6.1'
|
gem 'rack-attack', '~> 6.1'
|
||||||
gem 'rails', '~> 6.0.0'
|
gem 'rails', '~> 6.0.2', '~> 6.0.2.1'
|
||||||
gem 'rails-i18n', '~> 6.0.0'
|
gem 'rails-i18n', '~> 6.0.0'
|
||||||
gem 'recaptcha', '~> 5.1'
|
gem 'recaptcha', '~> 5.1'
|
||||||
gem 'redis', '~> 4.1'
|
gem 'redis', '~> 4.1'
|
||||||
|
|
|
@ -530,7 +530,7 @@ DEPENDENCIES
|
||||||
pundit-matchers (~> 1.6)
|
pundit-matchers (~> 1.6)
|
||||||
rack (= 2.2.0)!
|
rack (= 2.2.0)!
|
||||||
rack-attack (~> 6.1)
|
rack-attack (~> 6.1)
|
||||||
rails (~> 6.0.0)
|
rails (~> 6.0.2.1, ~> 6.0.2)
|
||||||
rails-erd (~> 1.5)
|
rails-erd (~> 1.5)
|
||||||
rails-i18n (~> 6.0.0)
|
rails-i18n (~> 6.0.0)
|
||||||
recaptcha (~> 5.1)
|
recaptcha (~> 5.1)
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2018-2019 Alex Kotov
|
Copyright (c) 2018-2020 Alex Kotov
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
@ -4,13 +4,13 @@ require_relative 'boot'
|
||||||
|
|
||||||
require 'rails'
|
require 'rails'
|
||||||
# Pick the frameworks you want:
|
# Pick the frameworks you want:
|
||||||
require 'active_model/railtie'
|
|
||||||
require 'active_job/railtie'
|
|
||||||
require 'active_record/railtie'
|
|
||||||
require 'active_storage/engine'
|
|
||||||
require 'action_controller/railtie'
|
require 'action_controller/railtie'
|
||||||
require 'action_mailer/railtie'
|
require 'action_mailer/railtie'
|
||||||
require 'action_view/railtie'
|
require 'action_view/railtie'
|
||||||
|
require 'active_job/railtie'
|
||||||
|
require 'active_model/railtie'
|
||||||
|
require 'active_record/railtie'
|
||||||
|
require 'active_storage/engine'
|
||||||
require 'sprockets/railtie'
|
require 'sprockets/railtie'
|
||||||
|
|
||||||
# Require the gems listed in Gemfile, including any gems
|
# Require the gems listed in Gemfile, including any gems
|
||||||
|
@ -57,7 +57,8 @@ module Partynest
|
||||||
config_for("settings/#{name}").deep_symbolize_keys.freeze
|
config_for("settings/#{name}").deep_symbolize_keys.freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
# Initialize configuration defaults for originally generated Rails version.
|
# Initialize configuration defaults
|
||||||
|
# for originally generated Rails version.
|
||||||
config.load_defaults 5.2
|
config.load_defaults 5.2
|
||||||
|
|
||||||
# Custom directories with classes and modules you want to be autoloadable.
|
# Custom directories with classes and modules you want to be autoloadable.
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
root_dir = File.expand_path '../..', __dir__
|
root_dir = File.expand_path '../..', __dir__
|
||||||
|
|
||||||
workers_count = ENV.fetch('WEB_CONCURRENCY') { 1 }
|
workers_count = ENV.fetch('RAILS_WEB_CONCURRENCY') { 1 }
|
||||||
threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
|
max_threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
|
||||||
|
min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count }
|
||||||
|
port_number = ENV.fetch('PORT') { 3000 }
|
||||||
|
|
||||||
# Specifies the number of `workers` to boot in clustered mode.
|
# Specifies the number of `workers` to boot in clustered mode.
|
||||||
# Workers are forked webserver processes. If using threads and workers together
|
# Workers are forked webserver processes. If using threads and workers together
|
||||||
|
@ -19,7 +21,7 @@ workers workers_count
|
||||||
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
||||||
# and maximum; this matches the default thread size of Active Record.
|
# and maximum; this matches the default thread size of Active Record.
|
||||||
#
|
#
|
||||||
threads threads_count, threads_count
|
threads min_threads_count, max_threads_count
|
||||||
|
|
||||||
# Use the `preload_app!` method when specifying a `workers` number.
|
# Use the `preload_app!` method when specifying a `workers` number.
|
||||||
# This directive tells Puma to first boot the application and load code
|
# This directive tells Puma to first boot the application and load code
|
||||||
|
@ -31,7 +33,7 @@ threads threads_count, threads_count
|
||||||
# Specifies the `port` that Puma will listen on to receive requests;
|
# Specifies the `port` that Puma will listen on to receive requests;
|
||||||
# default is 3000.
|
# default is 3000.
|
||||||
#
|
#
|
||||||
port ENV.fetch('PORT') { 3000 }
|
port port_number
|
||||||
|
|
||||||
# Allow puma to be restarted by `rails restart` command.
|
# Allow puma to be restarted by `rails restart` command.
|
||||||
plugin :tmp_restart
|
plugin :tmp_restart
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
root_dir = File.expand_path '../..', __dir__
|
root_dir = File.expand_path '../..', __dir__
|
||||||
|
|
||||||
workers_count = ENV.fetch('WEB_CONCURRENCY') { 1 }
|
workers_count = ENV.fetch('RAILS_WEB_CONCURRENCY') { 1 }
|
||||||
threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
|
max_threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
|
||||||
|
min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count }
|
||||||
|
|
||||||
# Specifies the number of `workers` to boot in clustered mode.
|
# Specifies the number of `workers` to boot in clustered mode.
|
||||||
# Workers are forked webserver processes. If using threads and workers together
|
# Workers are forked webserver processes. If using threads and workers together
|
||||||
|
@ -19,7 +20,7 @@ workers workers_count
|
||||||
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
||||||
# and maximum; this matches the default thread size of Active Record.
|
# and maximum; this matches the default thread size of Active Record.
|
||||||
#
|
#
|
||||||
threads threads_count, threads_count
|
threads min_threads_count, max_threads_count
|
||||||
|
|
||||||
# Use the `preload_app!` method when specifying a `workers` number.
|
# Use the `preload_app!` method when specifying a `workers` number.
|
||||||
# This directive tells Puma to first boot the application and load code
|
# This directive tells Puma to first boot the application and load code
|
||||||
|
@ -33,9 +34,6 @@ threads threads_count, threads_count
|
||||||
#
|
#
|
||||||
bind "unix://#{File.join(root_dir, 'tmp', 'sockets', 'puma.sock')}"
|
bind "unix://#{File.join(root_dir, 'tmp', 'sockets', 'puma.sock')}"
|
||||||
|
|
||||||
# Allow puma to be restarted by `rails restart` command.
|
|
||||||
# plugin :tmp_restart
|
|
||||||
|
|
||||||
# Use "path" as the file to store the server info state. This is
|
# Use "path" as the file to store the server info state. This is
|
||||||
# used by "pumactl" to query and control the server.
|
# used by "pumactl" to query and control the server.
|
||||||
#
|
#
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
root_dir = File.expand_path '../..', __dir__
|
root_dir = File.expand_path '../..', __dir__
|
||||||
|
|
||||||
workers_count = ENV.fetch('WEB_CONCURRENCY') { 1 }
|
workers_count = ENV.fetch('RAILS_WEB_CONCURRENCY') { 1 }
|
||||||
threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
|
max_threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
|
||||||
|
min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count }
|
||||||
|
|
||||||
# Specifies the number of `workers` to boot in clustered mode.
|
# Specifies the number of `workers` to boot in clustered mode.
|
||||||
# Workers are forked webserver processes. If using threads and workers together
|
# Workers are forked webserver processes. If using threads and workers together
|
||||||
|
@ -19,7 +20,7 @@ workers workers_count
|
||||||
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
||||||
# and maximum; this matches the default thread size of Active Record.
|
# and maximum; this matches the default thread size of Active Record.
|
||||||
#
|
#
|
||||||
threads threads_count, threads_count
|
threads min_threads_count, max_threads_count
|
||||||
|
|
||||||
# Use the `preload_app!` method when specifying a `workers` number.
|
# Use the `preload_app!` method when specifying a `workers` number.
|
||||||
# This directive tells Puma to first boot the application and load code
|
# This directive tells Puma to first boot the application and load code
|
||||||
|
@ -33,9 +34,6 @@ threads threads_count, threads_count
|
||||||
#
|
#
|
||||||
bind "unix://#{File.join(root_dir, 'tmp', 'sockets', 'puma.sock')}"
|
bind "unix://#{File.join(root_dir, 'tmp', 'sockets', 'puma.sock')}"
|
||||||
|
|
||||||
# Allow puma to be restarted by `rails restart` command.
|
|
||||||
# plugin :tmp_restart
|
|
||||||
|
|
||||||
# Use "path" as the file to store the server info state. This is
|
# Use "path" as the file to store the server info state. This is
|
||||||
# used by "pumactl" to query and control the server.
|
# used by "pumactl" to query and control the server.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
%w[
|
Spring.watch(
|
||||||
.ruby-version
|
'.ruby-version',
|
||||||
.rbenv-vars
|
'.ruby-gemset',
|
||||||
tmp/restart.txt
|
'.rbenv-vars',
|
||||||
tmp/caching-dev.txt
|
'tmp/restart.txt',
|
||||||
].each { |path| Spring.watch(path) }
|
'tmp/caching-dev.txt',
|
||||||
|
)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
test:
|
test:
|
||||||
service: Disk
|
service: Disk
|
||||||
root: <%= Rails.root.join 'tmp', 'storage' %>
|
root: <%= Rails.root.join 'tmp/storage' %>
|
||||||
|
|
||||||
local:
|
local:
|
||||||
service: Disk
|
service: Disk
|
||||||
|
|
|
@ -4,7 +4,7 @@ require 'csv'
|
||||||
|
|
||||||
def csv_foreach(filename, &block)
|
def csv_foreach(filename, &block)
|
||||||
CSV.foreach(
|
CSV.foreach(
|
||||||
Rails.root.join('db', 'data', "#{filename}.csv"),
|
Rails.root.join("db/data/#{filename}.csv"),
|
||||||
col_sep: '|',
|
col_sep: '|',
|
||||||
&block
|
&block
|
||||||
)
|
)
|
||||||
|
|
Reference in a new issue