Project

General

Profile

Refactor #13978

Replace AR connection value_to_boolean method with Foreman::Cast

Added by Dominic Cleal about 6 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

The host common #lookup_values_attributes= method uses an internal Active Record method value_to_boolean to parse the _destroy parameter from the nested attributes supplied by the UI.

https://github.com/theforeman/foreman/blob/1.11.0-RC1/app/models/concerns/host_common.rb#L54-L58

This method has been moved in Rails 4.2 and since it's really rather internal, it should be replaced by Foreman::Cast.to_bool or similar.


Related issues

Blocks Foreman - Feature #13244: Upgrade Ruby on Rails to 4.2Closed2016-01-15

Associated revisions

Revision 904367f1 (diff)
Added by Dominic Cleal about 6 years ago

fixes #13978 - replace AR value_to_boolean with our caster

In Rails 4.2, value_to_boolean was moved further into ActiveRecord's
column type classes. Replace the use of this internal method with
Foreman's own well-tested caster.

History

#1 Updated by Dominic Cleal about 6 years ago

#2 Updated by The Foreman Bot about 6 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Dominic Cleal
  • Pull request https://github.com/theforeman/foreman/pull/3276 added

#3 Updated by Dominic Cleal about 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal about 6 years ago

  • Legacy Backlogs Release (now unused) set to 136

Also available in: Atom PDF