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

Fix deprecation warnings on Rails 5.2 (and some 5.1 fixes) #849

Merged
merged 3 commits into from
Dec 20, 2017

Conversation

jhawthorn
Copy link
Contributor

@jhawthorn jhawthorn commented Dec 20, 2017

This fixes migration warnings which were introduced in Rails 5.0 and became errors in Rails 5.1.

This also fixes deprecation warnings introduced in Rails 5.2

DEPRECATION WARNING: Dangerous query method (method whose arguments are used as raw SQL) called with non-attribute argument(s): "...". 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().

I believe the build error here is the same that is on master

We allow activerecord >= 4.0, so we should do the same for railties
(which is just a dev dependency)
Rails 5.0+ wants us to specify the version of Rails we intend the
migration for.

This causes a deprecation warning on rails 5.0 and 5.1, and errors on
rails 5.2
Fixes warnings like:

DEPRECATION WARNING: Dangerous query method (method whose arguments are
used as raw SQL) called with non-attribute argument(s):
"\"friendly_id_slugs\".id DESC". 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().
@jhawthorn jhawthorn mentioned this pull request Dec 20, 2017
11 tasks
Copy link
Collaborator

@parndt parndt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@parndt parndt merged commit a29e7d7 into norman:master Dec 20, 2017
@jrochkind
Copy link

time for a release to work on 5.1/5.2, or not yet?

@parndt
Copy link
Collaborator

parndt commented May 22, 2018

Have a few other things I'd like to tidy up first, but soon. 👍

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

Successfully merging this pull request may close these issues.

3 participants