Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Extract #disable_notifiers out of #update_notifiers

  • Loading branch information...
commit de38e5968491f096717ff9f8eac9ac6eb6ee8191 1 parent cb6a5d9
@sr sr authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/integrity/project.rb
View
12 lib/integrity/project.rb
@@ -102,9 +102,7 @@ def update_notifiers(to_enable, config)
to_enable = Array(to_enable)
config ||= {}
- to_disable = enabled_notifiers.select { |notifier| ! to_enable.include?(notifier.name) }
- to_disable.each { |notifier| notifier.update_attributes(:enabled => false) }
-
+ disable_notifiers(to_enable)
config.each_pair { |name, config|
notifier = notifiers.first(:name => name)
@@ -149,6 +147,14 @@ def set_permalink
gsub(/-*$/, "")
end
+ def disable_notifiers(to_enable)
+ enabled_notifiers.select { |notifier|
+ ! to_enable.include?(notifier.name) }.
+ each { |notifier|
+ notifier.update_attributes(:enabled => false) }
+ end
+
+
def delete_working_directory
commits.all(:project_id => id).destroy!
ProjectBuilder.delete_working_directory(self)
Please sign in to comment.
Something went wrong with that request. Please try again.