This PR improves the user experience of using the rails console (rails c).
Normally, to use the rails console, one would need to set the RequestContext.community to be able to run most commands. With the changes in this PR, the console will automatically set a community if it can, and will provide some instructions on how to create one / switch communities if there are 0 or multiple.
IRB profile
Additionally, this defines an IRB profile that can be added in your ~/.irbrc as follows:
Qpixel.irb! if defined?(Qpixel)
It will change the prompt to show the current rails environment and current community
.
.
It will update automatically when you switch community:
Overview
In full, these changes look like the following:
.
If no communities are found, the following is displayed in development:
If no communities are found, the following is displayed in In production:
If an error occurs (usually related to missing database settings):
This PR improves the user experience of using the rails console (
rails c
).Normally, to use the rails console, one would need to set the
RequestContext.community
to be able to run most commands. With the changes in this PR, the console will automatically set a community if it can, and will provide some instructions on how to create one / switch communities if there are 0 or multiple.IRB profile
Additionally, this defines an IRB profile that can be added in your
~/.irbrc
as follows:It will change the prompt to show the current rails environment and current community
.
. It will update automatically when you switch community:
Overview
In full, these changes look like the following:
.
If no communities are found, the following is displayed in development:
If no communities are found, the following is displayed in In production:
If an error occurs (usually related to missing database settings):