Skip to content

Commit

Permalink
Add pluggable notification_types
Browse files Browse the repository at this point in the history
Allow plugins to bring their own notification_types in
`content/notification_types.yml`
  • Loading branch information
agrare committed Sep 16, 2022
1 parent 417582d commit e6f9435
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/models/notification_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def self.seed
end

def self.seed_data
fixture_file = File.join(FIXTURE_DIR, 'notification_types.yml')
File.exist?(fixture_file) ? YAML.load_file(fixture_file) : []
fixture_files = Vmdb::Plugins.flat_map { |plugin| plugin.root.join("content/notification_types.yml") }
fixture_files << FIXTURE_DIR.join('notification_types.yml')

fixture_files.select(&:exist?).flat_map { |f| YAML.load_file(f) }
end
end

0 comments on commit e6f9435

Please sign in to comment.