-
Notifications
You must be signed in to change notification settings - Fork 900
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
Promote supports feature to ApplicationRecord #23140
base: master
Are you sure you want to change the base?
Conversation
@agrare Please also review. |
Adding supports feature to a few more core models. It makes sense to have this as a base class for all
50dd7f1
to
bfbecf9
Compare
update:
|
Checked commit kbrock@bfbecf9 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint |
@@ -12,6 +12,7 @@ class ApplicationRecord < ActiveRecord::Base | |||
include ArHrefSlug | |||
include ToModelHash | |||
include ArVisibleAttribute | |||
include SupportsFeatureMixin |
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.
this is the 1 addition.
Moves this include
to ApplicationRecord
I understand the intent to avoid duplication here, but "most models" isn't really accurate. There are 457 models roughly, and only 73 have this, which means only 16% of models are like this. One upside to having it in specific models is we can know what models are the things that are "CI"s (i.e. things that we externally manage). That gets me wondering if we should have a I'm not against this PR, but I'm not sure - would like a second opinion from @agrare and/or @jrafanie |
haha, if you can name what this commonality is, we could probably create it. Ideally, all of these things should be reportable, support features, taggable, etc. We can override in classes that can't do one or more of these things if desired. Not sure how much we want to pull into the common place. |
I think having a plugin that says "I'm a taggable, rbac applyable, data model that is in each provider" may have merit. |
Most models include
SupportsFeatureMixin
. This moves up toApplicationRecord
+1/-73