Skip to content

Instantly share code, notes, and snippets.

@whitered
Created May 16, 2011 10:16
Show Gist options
  • Save whitered/974196 to your computer and use it in GitHub Desktop.
Save whitered/974196 to your computer and use it in GitHub Desktop.
RBP ignore
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