-
Notifications
You must be signed in to change notification settings - Fork 897
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
introduce User.lower_userid to remove some arel across a few repos #20532
Conversation
userid&.downcase | ||
end | ||
|
||
virtual_attribute :lower_userid, :string, :arel => ->(t) { t.grouping(t[:userid].lower) } |
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.
Only thing I don't like about this is that it's now exposed to reporting.
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.
we need to come up with a way to hide attributes from reporting and from the api
This is also useful when we want to deprecate a fields. Have them work but not show up in the drop downs/documentation
I have had an idea mulling in my head for a while, but never know if this is viable or not - due to the complexity of add ing a concept that isn't really in rails at this time. attributes
and hidden_attributes
kinda like methods
(privatet_methods
) and public_methods
?
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 like the public/private designation idea. What if we just literally make them private, then in reporting, as we enumerate the methods we only take public virtual methods?
private
virtual_attribute :lower_userid, :string, :arel => ->(t) { t.grouping(t[:userid].lower) }
and/or
private virtual_attribute :lower_userid, :string, :arel => ->(t) { t.grouping(t[:userid].lower) }
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.
If we are using send
to call these parameters, then that will require changes in using them
but when we are constructing the api or the drop down, we can look at them.
Nice to not introduce any new metadata
I do wonder how this will work if we use the class when it hasn't been used yet. the attributes may not be defined yet.
will look into this
wipping until we find a good way to hide attributes in the api and report builder |
Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to start using. This allows attributes to still work, but just not be advertised on our public apis (i.e.: report builder and rest api). This allows This fixes ManageIQ#18130 This enables ManageIQ#20532
Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to start using. This allows attributes to still work, but just not be advertised on our public apis (i.e.: report builder and rest api). This allows This fixes ManageIQ#18130 This enables ManageIQ#20532
Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to start using. Now, the attributes are still accessible. So nothing will break. But these attributes are no longer advertised on the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532
Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to start using. Now, the attributes are still accessible. So nothing will break. But these attributes are no longer advertised on the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532
Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to start using. Now, the attributes are still accessible. So nothing will break. But these attributes are no longer advertised on the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532
Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to use. After this change, the attributes are still accessible. So nothing will break, but these attributes are no longer advertised in the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532
Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to use. After this change, the attributes are still accessible. So nothing will break, but these attributes are no longer advertised in the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532
Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to start using. Now, the attributes are still accessible. So nothing will break. But these attributes are no longer advertised on the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532 Hide deprecated and duplicate attributes Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to use. After this change, the attributes are still accessible. So nothing will break, but these attributes are no longer advertised in the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532
Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to start using. Now, the attributes are still accessible. So nothing will break. But these attributes are no longer advertised on the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532 Hide deprecated and duplicate attributes Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to use. After this change, the attributes are still accessible. So nothing will break, but these attributes are no longer advertised in the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532
Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to start using. Now, the attributes are still accessible. So nothing will break. But these attributes are no longer advertised on the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532 Hide deprecated and duplicate attributes Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to use. After this change, the attributes are still accessible. So nothing will break, but these attributes are no longer advertised in the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532
Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to start using. Now, the attributes are still accessible. So nothing will break. But these attributes are no longer advertised on the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532 Hide deprecated and duplicate attributes Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to use. After this change, the attributes are still accessible. So nothing will break, but these attributes are no longer advertised in the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532
Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to start using. Now, the attributes are still accessible. So nothing will break. But these attributes are no longer advertised on the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532 Hide deprecated and duplicate attributes Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to use. After this change, the attributes are still accessible. So nothing will break, but these attributes are no longer advertised in the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532
Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised to the customer as attributes to use. After this change, the attributes are still accessible. Just these attributes are no longer advertised on the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532 Hide deprecated and duplicate attributes. Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to use. After this change, the attributes are still accessible. So nothing will break, but these attributes are no longer advertised in the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532
Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised to the customer as attributes to use. After this change, the attributes are still accessible. Just these attributes are no longer advertised on the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532 Hide deprecated and duplicate attributes. Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to use. After this change, the attributes are still accessible. So nothing will break, but these attributes are no longer advertised in the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532
Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised to the customer as attributes to use. After this change, the attributes are still accessible. Just these attributes are no longer advertised on the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532 Hide deprecated and duplicate attributes. Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to use. After this change, the attributes are still accessible. So nothing will break, but these attributes are no longer advertised in the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532
status: will hide this attribute using #20664 |
Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised to the customer as attributes to use. After this change, the attributes are still accessible. Just these attributes are no longer advertised on the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532 Hide deprecated and duplicate attributes. Some virtual_attributes are not needed in reporting nor the api. Some deprecated attributes should not be advertised for customers to use. After this change, the attributes are still accessible. So nothing will break, but these attributes are no longer advertised in the public apis (i.e.: report builder and rest api). This allows us to control which parts of our models are exposed. This fixes ManageIQ#18130 This enables ManageIQ#20532
updated to use |
Checked commits kbrock/manageiq@c30555a~...668e834 with ruby 2.6.3, rubocop 0.82.0, haml-lint 0.35.0, and yamllint |
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.
Looks fine to me. Seems like Jason's concern was addressed, so I think this is good to go.
Sidenote: I think lower_*
reads a little weird, but seems like it is derived from the posgresql string function, so I don't think it is worth trying to do an exercise of trying to find a better name, so just leave it.
I noticed a few lowercase comparisons for userid and a lookup by userid method
this allows us to just use active record where instead of the arel junk.
I would prefer if we used this instead of
lookup_by_name()
but want a second opinion on that one before moving forward. specifically the in region filter.this is developer focused