Skip to content

Commit

Permalink
enable and disable_maintenance should be bang methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jhass committed Aug 13, 2011
1 parent cd5cac0 commit 91c919a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/controllers/pods_controller.rb
Expand Up @@ -84,10 +84,10 @@ def switch_maintenance
@pod = Pod.find(params[:pod_id])
if current_user.owns?(@pod)
if @pod.maintenance?
@pod.disable_maintenance
@pod.disable_maintenance!
flash[:notice] = "Maintenance mode disabled"
else
@pod.enable_maintenance
@pod.enable_maintenance!
flash[:notice] = "Maintenance mode enabled"
end
success = true
Expand Down
4 changes: 2 additions & 2 deletions app/models/pod.rb
Expand Up @@ -155,11 +155,11 @@ def compute_uptime!

# Actions

def enable_maintenance
def enable_maintenance!
self.update_attributes(:maintenance => Time.now)
end

def disable_maintenance
def disable_maintenance!
self.update_attributes(:maintenance => nil)
end

Expand Down

0 comments on commit 91c919a

Please sign in to comment.