Fix Duplicate type definition error during runtime changes in dev environment#90
Merged
rainerdema merged 1 commit intomasterfrom Mar 27, 2020
Conversation
7528aa7 to
1c76e60
Compare
1c76e60 to
76c1e01
Compare
AlessioRocco
previously approved these changes
Mar 27, 2020
ChristianRimondi
previously approved these changes
Mar 27, 2020
After a runtime change during the autoloading of the classes in the development environment (where we usually have the cache_classes config param set to false), there is a conflict with the DSL: At this point, Rails re-loads the files but the code still retains references to old objects and causes a circular dependency error in the PaymentSource interface during the `orphan_type` assignment. With this change in the `payment_sources` configuration uses strings to force the correct autoloading of all the classes which are re-converted into constants during the `orphan_type` assignment.
ad6f64c
76c1e01 to
ad6f64c
Compare
AlessioRocco
approved these changes
Mar 27, 2020
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quick Info
With these changes, in the
payment_sourcesconfiguration param, uses strings to force the correct autoloading of all the classes which are re-converted into constants during theorphan_typeassignment and stop the circular dependencies errors indevenvironment.Note
This is a problem that probably occurred only in the development environment:
Because the
cache_classesconfig flag in Soliduscofing/environments/development.rbconfiguration is usually set tofalse.Info
For more information about this problem, consult these issues in
graphql-ruby:rmosolgo/graphql-ruby#2716
rmosolgo/graphql-ruby#935