Project

General

Profile

Bug #30821

ActiveModel::UnknownAttributeError: unknown attribute 'name' for Permission

Added by Tristan Robert about 1 month ago. Updated about 1 month ago.

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

Description

When packaging (rpm or deb) my plugin I have this error:

ActiveModel::UnknownAttributeError: unknown attribute 'name' for Permission

I don't understand why because I didn't change the Permission declaration syntax in my engine. Permission on controller is declared as it should be:
https://github.com/theforeman/foreman_fog_proxmox/blob/53a433554974807d522b937904c1256789a03274/lib/foreman_fog_proxmox/engine.rb#L48
https://github.com/theforeman/foreman/blob/9a251d43967605dbef0bfec79d4ec8e1a7f5e919/test/unit/plugin_test.rb#L580
How could I fix this? What is the correct Permission syntax?


Related issues

Related to Foreman - Refactor #29498: make Plugin#pending_migration check plugin migrations instead of core onesClosed
Related to Foreman - Bug #31088: 'relation "permissions" does not exist' error during new 2.2 version installationNew

Associated revisions

Revision a4f4c130 (diff)
Added by Ondřej Ezr about 1 month ago

Fixes #30821 - checking core migrations as well

We need this to support plugins that need the DB fully migrated.
For example, permissions need the core migrations up.
Especially if the plugin has no migrations, this becomes important.

History

#1 Updated by Ewoud Kohl van Wijngaarden about 1 month ago

  • Category set to Plugin integration
  • Project changed from Packaging to Foreman

Moving to Foreman since I think the real issue isn't in packaging. In https://github.com/theforeman/foreman-packaging/pull/5709#issuecomment-691232344 I wrote a bit longer explanation, but the short version is that since 3a5d4162c0d0cbfaaf690d7b48b273bd097731ea pending_migrations returns false if a plugin has no DB migrations.

#2 Updated by Ewoud Kohl van Wijngaarden about 1 month ago

  • Related to Refactor #29498: make Plugin#pending_migration check plugin migrations instead of core ones added

#3 Updated by The Foreman Bot about 1 month ago

  • Assignee set to Ondřej Ezr
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/7988 added

#4 Updated by Tomer Brisker about 1 month ago

  • Target version set to 2.0.3

#5 Updated by The Foreman Bot about 1 month ago

  • Fixed in Releases 2.3.0 added

#6 Updated by Tomer Brisker about 1 month ago

  • Target version changed from 2.0.3 to 2.2.0
  • Fixed in Releases 2.2.0 added
  • Fixed in Releases deleted (2.3.0)

#7 Updated by Ondřej Ezr about 1 month ago

  • Status changed from Ready For Testing to Closed

#8 Updated by Ewoud Kohl van Wijngaarden 4 days ago

  • Related to Bug #31088: 'relation "permissions" does not exist' error during new 2.2 version installation added

Also available in: Atom PDF