Method: Integrity::Project::Helpers::Notifiers#update_notifiers

Defined in:
lib/integrity/project/notifiers.rb

#update_notifiers(to_enable, config) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/integrity/project/notifiers.rb', line 20

def update_notifiers(to_enable, config)
  config.each_pair { |name, config|
    notifier = notifiers.first(:name => name)
    notifier ||= notifiers.new(:name => name)

    notifier.enabled = to_enable.include?(name)
    notifier.config  = config
    notifier.save
  }
end