Project

General

Profile

Refactor #12457

Use .exists? to check subnet exists for Rails 4 compatibility

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

On app/models/subnet.rb, the method `self.import` uses 'if first(:conditions => attrs)`. It no longer is an alias for `find(:first, *args)` but now it just fetches the first X records (`first(X)`). `.exists?` is a suitable equivalent


Related issues

Related to Foreman - Tracker #3157: Rails 4.1 upgrade tasksClosed2013-09-27

Associated revisions

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

Fixes #12457 - Use .exists? to check subnet exists on Rails 4

On app/models/subnet.rb, the method `self.import` uses `if
first(:conditions => attrs)`. It no longer is an alias for
`find(:first, *args)` but now it just fetches the first X
records (`first(X)`). `.exists?` is a suitable equivalent

History

#1 Updated by Daniel Lobato Garcia almost 4 years ago

#2 Updated by The Foreman Bot almost 4 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Daniel Lobato Garcia
  • Pull request https://github.com/theforeman/foreman/pull/2907 added

#3 Updated by Dominic Cleal almost 4 years ago

  • 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