Project

General

Profile

Actions

Refactor #13409

closed

Remove maintain_test_schema! Rails initializer

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

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

Description

The config/initializers/0_maintain_test_schema.rb initializer added in #7230 can potentially be removed with some further fixes.

It exists to initialise the test database before the main Rails app and models are initialised, fixing a couple of bugs where loading the model requires the table to already be available. If the table isn't available then validators etc. aren't set up correctly and tests may fail. Removing the initialiser and the test DB, then running rake test shows the issue. More info in #12873.

#13039 fixed one issue, but I think two further fixes are required:

1) validates_lengths_from_database needs to avoid reading DB information to set up its validators. https://github.com/rubiety/validates_lengths_from_database/pull/12 fixes this.

2) Our own validate_inclusion_in_families validator should not check for the attribute's existence - this check can probably be removed.


Related issues 4 (0 open4 closed)

Related to Foreman - Feature #7230: Upgrade Ruby on Rails to 4.1ClosedDaniel Lobato Garcia08/22/2014Actions
Related to Foreman - Refactor #13039: Remove DB queries from class of UnattendedControllerClosedDominic Cleal01/07/2016Actions
Related to Foreman - Feature #12873: Update Rails to 4.1.latestClosedDominic Cleal12/18/2015Actions
Blocked by Foreman - Bug #13574: Plugins with Setting subclasses raise super: no superclass method `load_defaults' errorClosedDominic Cleal02/05/2016Actions
Actions #1

Updated by Dominic Cleal about 8 years ago

Actions #2

Updated by Dominic Cleal about 8 years ago

  • Related to Refactor #13039: Remove DB queries from class of UnattendedController added
Actions #3

Updated by Dominic Cleal about 8 years ago

Actions #4

Updated by Dominic Cleal about 8 years ago

  • Blocked by Bug #13574: Plugins with Setting subclasses raise super: no superclass method `load_defaults' error added
Actions #5

Updated by Dominic Cleal about 8 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal
Actions #6

Updated by The Foreman Bot about 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3182 added
Actions #7

Updated by Dominic Cleal about 8 years ago

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

Updated by Dominic Cleal about 8 years ago

  • translation missing: en.field_release set to 71
Actions

Also available in: Atom PDF