Skip to content

Fix the error with accessing a non-existent attribute in the config#16

Open
AnotherRegularDude wants to merge 2 commits into
bigcommerce:mainfrom
Cado-Labs:feature/fix-accesss-for-rails-config
Open

Fix the error with accessing a non-existent attribute in the config#16
AnotherRegularDude wants to merge 2 commits into
bigcommerce:mainfrom
Cado-Labs:feature/fix-accesss-for-rails-config

Conversation

@AnotherRegularDude
Copy link
Copy Markdown

Changes

Fixes

  • Fixed an error that occurred when checking for the existence of attributes (before_fork_callbacks, after_fork_callbacks) in the config: when checking the value for nil, we can get a NoMethodError if no one has set this attribute before.

@AnotherRegularDude
Copy link
Copy Markdown
Author

Any review, pease 🙏

Logs with NoMethodError is very annoying and gem doesn't work as expected in some cases.

Comment thread spec/spec_helper.rb
require_relative 'simplecov_helper'
require 'bigcommerce/prometheus'
require 'pry'
require 'rails'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gem is used in non-rails systems, so we shouldn't pull in this dependency here.

spec.add_development_dependency 'bundler-audit', '>= 0.6'
spec.add_development_dependency 'null-logger', '>= 0.1'
spec.add_development_dependency 'pry', '>= 0.12'
spec.add_development_dependency 'railties', '>= 6.0.0'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gem supports Rails 5.2+, so we'll need to not limit this to 6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants