Project

General

Profile

Actions

Refactor #23234

closed

remove friendly_id <5.0 workarounds

Added by Anonymous over 6 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
-
Fixed in Releases:
Found in Releases:

Description

With Rails 5.2:

 - message: 'Dangerous query method (method whose arguments are used as raw SQL) called
     with non-attribute argument(s): "CASE WHEN \"hostgroups\".\"title\" = ''928644347''
     THEN 1 ELSE 0 END". 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().'
   callstack: app/controllers/api/base_controller.rb:407:in `prioritize_friendly_name_records'

app/controllers/api/base_controller.rb:378 says: "#Should be replaced after moving to friendly_id version >= 5.0"

This should be re-done now in a Rails 5.2 friendlier way.


Related issues 6 (0 open6 closed)

Related to Foreman - Bug #8343: API resource_scope ignores optionsClosedShimon Shtein11/11/2014Actions
Related to Foreman - Tracker #21834: Rails 5.2 upgrade tasksClosed

Actions
Related to Foreman - Refactor #23300: Do not use string interpolation when composing SQL queries.ClosedActions
Related to Foreman - Refactor #23806: raise gem dependencies to Rails 5.2 compatible versionsClosed06/04/2018Actions
Related to Foreman - Bug #32704: The /api/usergroups/:usergroup_id/external_usergroups API is not accepting 1-group as the name of usergroupClosedTomer BriskerActions
Blocks Foreman - Tracker #24837: Rails 6.0 TrackerClosed

Actions
Actions

Also available in: Atom PDF