Skip to content

Conversation

husteadrobert
Copy link

Addresses isssue #528

Checks to see if Rails::Railtie is defined, and if so sets the Railtie to run before_initialize. I've run this locally with no issues and specs are passing.

lib/split.rb Outdated
@@ -66,4 +66,11 @@ def configure
end
end

Split.configure {}
# Check to see if being run in a Rails application. If so, wait until before_initialize to run configuration so Gems that create ENV variables have the chance to initialize first.
if defined?(Rails::Railtie)
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Sure thing! I thought being explicit (since we will be inheriting from Railties) was better, but seeing the convention of checking for ::Rails seems like a good idea. Updated!

@andrehjr
Copy link
Member

Thanks for the PR @husteadrobert! I left a small comment, after that I'll merge it :)

@husteadrobert
Copy link
Author

I don't seem to be able to re-request a review, so I'm leaving a comment here. If you need any other changes, please let me know! @andrehjr

@andrehjr
Copy link
Member

Thanks @husteadrobert with this PR, it should be possible to use Figaro :)

@andrehjr andrehjr merged commit 7eb8f26 into splitrb:master Mar 27, 2019
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.

2 participants