Created
May 16, 2011 10:16
-
-
Save whitered/974196 to your computer and use it in GitHub Desktop.
RBP ignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update | |
@membership = Membership.find(params[:id]) # this line sits in before_filter | |
raise ActiveRecord::RecordNotFound unless @membership.group_owner == current_user # ignore_rbp | |
is_admin = params[:membership] && params[:membership][:is_admin] | |
@membership.update_attribute(:is_admin, is_admin) unless is_admin.nil? | |
redirect_to @membership.group | |
end | |
# RBP advices to use scope access on the second line of the method, but it's impossible in my model, | |
# so I've added the comment that makes RBP ignore that error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment