Skip to content

Commit

Permalink
Fix deprecation warning for update_attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Humphreys authored and masonhensley committed Jan 21, 2020
1 parent 4a7540b commit e1ffc89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions app/controllers/policy_manager/user_terms_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ def blocking_terms
format.html{ }
format.json{ render json: PolicyManager::Config.rules
.select{|p| p.blocking }
.map(&:name)
.map(&:name)
}
end
end

def accept_multiples
rules = current_user.pending_policies.map{|o| "policy_rule_#{o.name}"}
resource_params = params.require(:user).permit(rules)
current_user.update_attributes(resource_params)
current_user.update(resource_params)
@pending_policies = current_user.pending_policies

respond_to do |format|
format.html{ }
format.json{ render json: @pending_policies }
Expand All @@ -50,11 +50,11 @@ def accept
@user_term = accept_term(@term)

respond_to do |format|
format.html{
format.html{
if @user_term.errors.any?
redirect_to root_url , notice: "hey there are some errors! #{@user_term.errors.full_messages.join()}"
else
redirect_to root_url
redirect_to root_url
end
}
format.js
Expand All @@ -70,11 +70,11 @@ def reject
@user_term = reject_term(@term)

respond_to do |format|
format.html{
format.html{
if @user_term.errors.any?
redirect_to root_url , notice: "hey there are some errors! #{@user_term.errors.full_messages.join()}"
else
redirect_to root_url
redirect_to root_url
end
}
format.js
Expand Down
2 changes: 1 addition & 1 deletion lib/policy_manager/exporter/handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def handle_zip_upload
resource
.portability_requests
.find_by(state: "progress")
.update_attributes(file_remote_url: zip_path)
.update(file_remote_url: zip_path)
end

def clear!
Expand Down

0 comments on commit e1ffc89

Please sign in to comment.