Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix zeitwerk load errors #183

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ We use Rspec for unit and acceptance testing:
bundle exec rspec
```

To run the Rails console:

```
DISABLE_SPRING=true bundle exec rails console
```

## Technical Description

### Resource components
Expand Down
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def transform_params
elsif status == 409
message = "The resource already exists."
else
Raven.capture_exception(exception)
message = exception.message
end

Expand Down
13 changes: 7 additions & 6 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ module Sashimi
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.1
config.autoload_paths << Rails.root.join('lib')
config.autoload_once_paths << Rails.root.join('lib')
config.autoload_paths << Rails.root.join("app", "models", "concerns")
config.autoload_paths += %W(#{config.root}/lib #{config.root}/lib/middleware)

# Allow middleware to be loaded. (compressed_requests)
config.autoload_lib(ignore: nil)
config.eager_load_paths << Rails.root.join("lib")
config.eager_load_paths << Rails.root.join("app", "models", "concerns")

# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
Expand All @@ -76,8 +75,8 @@ class Application < Rails::Application
config.lograge.enabled = true
config.lograge.formatter = Lograge::Formatters::Logstash.new
config.lograge.logger = LogStashLogger.new(type: :stdout)
config.logger = config.lograge.logger ## LogStashLogger needs to be pass to rails logger, see roidrage/lograge#26
config.log_level = ENV["LOG_LEVEL"].to_sym ## Log level in a config level configuration
config.logger = config.lograge.logger
config.log_level = ENV["LOG_LEVEL"].to_sym

config.lograge.ignore_actions = ["HeartbeatController#index", "IndexController#index"]
config.lograge.ignore_custom = lambda do |event|
Expand All @@ -93,6 +92,8 @@ class Application < Rails::Application
}
end

config.action_dispatch.debug_exception_log_level = :error

# configure caching
config.cache_store = :mem_cache_store, ENV["MEMCACHE_SERVERS"], { namespace: ENV["APPLICATION"] }

Expand Down
2 changes: 2 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
url: "/report_files/:filename",
use_timestamp: false,
}

config.action_dispatch.show_exceptions = false
end

#BetterErrors::Middleware.allow_ip! ENV['TRUSTED_IP']
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/middlewares.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "./lib/middleware/compressed_requests"

Rails.application.configure do
Expand Down
2 changes: 2 additions & 0 deletions lib/middleware/compressed_requests.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Middleware
class CompressedRequests
def initialize(app)
Expand Down
Loading