Project

General

Profile

Bug #12059

AuthSource allow_nil for hosts should be removed

Added by Daniel Lobato Garcia almost 4 years ago. Updated about 1 year ago.

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

Description

When we migrated to the new migration syntax, the clause 'validate_length_of :host' was wrongly translated. It contains a clause 'allow_nil' that allows it to be nil, but in Rails 3 the :presence => true clause takes precedence. If you try to run AuthSourceLdap.new(:host => nil) it will fail as it need a host (correctly). This clause has to be removed so that Rails 4 doesn't allow to create AuthSourceLdap without a host, as :allow_nil takes precedence in Rails 4.

Associated revisions

Revision c2af42a0 (diff)
Added by Daniel Lobato Garcia almost 4 years ago

Fixes #12059 - AuthSourceLdap allow_nil should be removed

When we migrated to the new migration syntax, the clause
`validate_length_of :host` was wrongly translated. It contains a clause
`allow_nil` that allows it to be nil, but in Rails 3 the `:presence =>
true` clause takes precedence.

If you try to run `AuthSourceLdap.new(:host => nil)` it will fail as it
needs a host (correctly). This clause has to be removed so that Rails
4 doesn't allow to create `AuthSourceLdap` without a host, as
`:allow_nil` takes precedence in Rails 4.

History

#1 Updated by Daniel Lobato Garcia almost 4 years ago

  • Subject changed from AuthSource allow_nil should apply to length only to AuthSource allow_nil for hosts should be removed

#2 Updated by The Foreman Bot almost 4 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2779 added
  • Pull request deleted ()

#3 Updated by Dominic Cleal almost 4 years ago

  • Assignee set to Daniel Lobato Garcia
  • Legacy Backlogs Release (now unused) set to 71

#4 Updated by Daniel Lobato Garcia almost 4 years ago

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

Also available in: Atom PDF