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

Console script for development #38

Merged
merged 2 commits into from
Mar 7, 2024
Merged

Console script for development #38

merged 2 commits into from
Mar 7, 2024

Conversation

lunohodov
Copy link
Owner

No description provided.

Requiring gem's entry point e.g. `require "monarch_migrate"` outside of
a Rails application, raises an error:

> uninitialized constant ActiveRecord (NameError)

During development, we may want to start an IRB console session in
the context of the gem. Requiring gem's entry point also loads a class
that extends ActiveRecord::Base. However, in this context, ActiveRecord
is not loaded.

Explicitly requiring ActiveRecord's railtie in gem's entry point solves
the problem.
The script starts an IRB console session in the context of the gem.
This is useful during development to test something quickly.

No database operations will work out of the box, though. This is a
future topic.
@lunohodov lunohodov marked this pull request as ready for review March 7, 2024 07:46
@lunohodov lunohodov merged commit 3ad5912 into main Mar 7, 2024
14 checks passed
@lunohodov lunohodov deleted the console branch March 7, 2024 07:46
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.

1 participant