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

[TimeProfile] Fix "Dangerous query method" warning #20045

Conversation

NickLaMuro
Copy link
Member

Similar fixes to what was given in #20036

DEPRECATION WARNING: Dangerous query method (method whose arguments are used as
raw SQL) called with non-attribute argument(s): "lower(description) ASC".
Non-attribute arguments will be disallowed in Rails 6.0. This method should not
be called with user-provided values, such as request parameters or model
attributes. Known-safe values can be passed by wrapping them in Arel.sql().

(called from ordered_by_desc at app/models/time_profile.rb:174)

These deprecation warnings display in rails 5.2
These fixes work in 5.1

Links

@miq-bot
Copy link
Member

miq-bot commented Apr 2, 2020

Checked commit NickLaMuro@d00c0b5 with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.28.0, and yamllint
1 file checked, 0 offenses detected
Everything looks fine. ⭐

@jrafanie
Copy link
Member

jrafanie commented Apr 3, 2020

@miq-bot add_label rails5.2
@miq-bot add_label jansa/yes?

@chessbyte chessbyte mentioned this pull request Apr 3, 2020
38 tasks
@jrafanie jrafanie self-assigned this Apr 3, 2020
@jrafanie jrafanie merged commit 9d91ddf into ManageIQ:master Apr 3, 2020
simaishi pushed a commit that referenced this pull request Apr 16, 2020
…deprecation_warning

[TimeProfile] Fix "Dangerous query method" warning

(cherry picked from commit 9d91ddf)
@simaishi
Copy link
Contributor

Jansa backport details:

$ git log -1
commit 3d4f6cf102ed219526fe3f87e3ff0e0940d979a2
Author: Joe Rafaniello <[email protected]>
Date:   Fri Apr 3 09:03:00 2020 -0400

    Merge pull request #20045 from NickLaMuro/fix_time_profile_rails_5_2_deprecation_warning

    [TimeProfile] Fix "Dangerous query method" warning

    (cherry picked from commit 9d91ddfefcb3918192f3f5015d90c040a04e9a29)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants