Actions
Refactor #23939
openTemplate "default" should cause templates to be seeded into all existing orgs and future ones
Status:
New
Priority:
Normal
Assignee:
-
Category:
Templates
Target version:
-
Description
The original idea behind "default" flag for templates is that they go into every new taxonomy. It should happen during seeding, and on new org/loc creation, but it doesn't seem like that's working correctly. Foreman_ansible, remote execution, and core all do this themselves manually in their seeders. To avoid duplication of this code, it would be nice if this could happen in the Template model.
Updated by Stephen Benjamin over 6 years ago
- Related to Bug #23891: Community Job Templates are not assigned to all orgs by default added
Updated by Ivan Necas over 6 years ago
- Triaged set to No
Do I understand it correctly, that it would mean having some `seed` method in the Templates, that would do:
def self.seed(template) sync = !Rails.env.test? && Setting[:remote_execution_sync_templates] template = import_raw!(File.read(template), :default => true, :locked => true, :update => sync) template.organizations = organizations if SETTINGS[:organizations_enabled] && template.present? template.locations = locations if SETTINGS[:locations_enabled] && template.present? end
Actions