-
Notifications
You must be signed in to change notification settings - Fork 167
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
Add database and schema to active record log #55
Add database and schema to active record log #55
Conversation
990fb2a
to
d1796d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for submitting this PR.
In terms of code, small changes noted.
In terms of functionality, it seems to me like a good feature. I would still open a ticket so we can link the PR to it and any further discussions around the logging.
Regarding the feature itself, I'd like to add a few more questions:
- would this be enabled by default?
- Is there a way to disable this logging if people don't want to see it?
d1796d0
to
8268e58
Compare
I agree, the rubocop is enable, the active_record_log configuration was added and the rails check version was removed. The active record log is enable by default. What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the updates, just a small note on the configuration defaults. 👍
lib/apartment.rb
Outdated
@@ -124,6 +125,12 @@ def extract_tenant_config | |||
rescue ActiveRecord::StatementInvalid | |||
{} | |||
end | |||
|
|||
def active_record_log | |||
return @active_record_log if defined?(@active_record_log) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use lib/apartment/railtie.rb
to set the default value.
I think we should default to false because if we default to true, when the users update the gem, they will start having more output than they used to, which might not be their desired behavior. Generally I'm in favor of keeping the current behavior, as the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no problem!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did change the default behavior to false
8268e58
to
ad4fbf1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! thansks
Prepare Release - 2.7.0 # Enhancements - [Resolves #70] Rake tasks define methods on main - #75 - Add database and schema to active record log. Configurable, defaults to false to keep current behavior - #55 # Bugfixes - [Fixes #61] Fix database create in mysql - #76 # Chores - Remove depracated tld_length config option: tld_length was removed in influitive#309, this configuration option doesn't have any effect now. - #72 - Using [diffend.io proxy](https://diffend.io) to safely check required gems - Added [story branch](https://github.com/story-branch/story_branch) to the configuration - Using travis-ci to run rubocop as well, replacing github actions: github actions do not work in fork's PRs
I just find useful to have a visual feedback of the database and schema in activerecord logs