Skip to content

Only load Railtie integration if Rails::Railtie is defined#52

Merged
byroot merged 1 commit into
byroot:masterfrom
Morriar:at-fix-railtie
Jun 6, 2022
Merged

Only load Railtie integration if Rails::Railtie is defined#52
byroot merged 1 commit into
byroot:masterfrom
Morriar:at-fix-railtie

Conversation

@Morriar
Copy link
Copy Markdown
Contributor

@Morriar Morriar commented Jun 6, 2022

As pointed by the Rails documentation, creating Railties should explicitly ensure that Rails::Railtie is defined.

There could be non-rails application use-cases where Rails is defined, yet Rails::Railtie is not loaded.

I'm not sure how to add a test for this, if you have any idea?

As pointed by the [Rails documentation](https://api.rubyonrails.org/classes/Rails/Railtie.html#class-Rails::Railtie-label-Creating+a+Railtie),
creating Railties should explicitly ensure that `Rails::Railtie` is defined.

There could be non-rails application use-cases where `Rails` is defined, yet
`Rails::Railtie` is not loaded.

Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@byroot byroot merged commit 4130a06 into byroot:master Jun 6, 2022
@Morriar Morriar deleted the at-fix-railtie branch June 6, 2022 19:53
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