Project

General

Profile

Actions

Bug #11851

closed

LookupKey deprecation warning on overriding of ActiveRecord::Base.inherited

Added by Dominic Cleal over 9 years ago. Updated over 6 years ago.

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

Description

Using the LookupKey base class can result in the following deprecation warning from Rails:

2.0.0-p353 :001 > LookupKey.all
  LookupKey Load (3.6ms)  SELECT "lookup_keys".* FROM "lookup_keys" ORDER BY lookup_keys.key
2015-09-16T14:23:26 [app] [W] DEPRECATION WARNING: It looks like something (probably a gem/plugin) is overriding the ActiveRecord::Base.inherited method. It is important that this hook executes so that your models are set up correctly. A workaround has been added to stop this causing an error in 3.2, but future versions will simply not work if the hook is overridden. If you are using Kaminari, please upgrade as it is known to have had this problem.
 | 
 | The following may help track down the problem: ["/home/dcleal/code/foreman/foreman/app/models/lookup_keys/lookup_key.rb", 34]
 | 
 |  (called from irb_binding at (irb):1)

It appears that the LookupKey.inherited method isn't calling "super".

This causes logging when used on develop as shown above, or with the PR for #9981.


Related issues 1 (0 open1 closed)

Related to Foreman - Refactor #10832: Make LookupKey an STI for puppet and variable keysClosedTom Caspy06/16/2015Actions
Actions #1

Updated by Dominic Cleal over 9 years ago

  • Related to Refactor #10832: Make LookupKey an STI for puppet and variable keys added
Actions #2

Updated by The Foreman Bot over 9 years ago

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

Updated by Dominic Cleal over 9 years ago

  • Assignee set to Shlomi Zadok
Actions #4

Updated by Shlomi Zadok over 9 years ago

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

Also available in: Atom PDF