Skip to content

Commit

Permalink
correcting update mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
erik committed Jul 9, 2012
1 parent c82548a commit fa2a105
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/profiles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ class ProfilesController < ApplicationController
before_filter :get_profile, :except => :ban

def ban
@profile = User.find(params[:id])
@profile.update_attributes({:is_banned => true}) if current_user && current_user.is_a?(Admin) && @profile
user = User.find(params[:id])
user.update_attribute(:is_banned, true) if current_user && current_user.is_a?(Admin) && user
redirect_to :back
return
end

def unban
@profile = User.find(params[:id])
@profile.update_attributes({:is_banned => false}) if current_user && current_user.is_a?(Admin) && @profile
user = User.find(params[:id])
user.update_attributes(:is_banned, false) if current_user && current_user.is_a?(Admin) && user
redirect_to :back
return
end
Expand Down

0 comments on commit fa2a105

Please sign in to comment.