Skip to content

Commit

Permalink
[C] Remove double validations in resourceful actions
Browse files Browse the repository at this point in the history
  • Loading branch information
scryptmouse authored and zdavis committed Feb 27, 2024
1 parent 0ea0a71 commit 5eacdce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/app/controllers/concerns/api/v1/resourceful.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ def auditing_security?
# @param [Symbol] ok
# @param [Symbol] error
# @return [Symbol]
def build_status_for(model, ok, error, context)
def build_status_for(model, ok, error, _context)
return ok unless action_name == "update" || action_name == "create"

model.valid?(context) ? ok : error
model.errors.none? ? ok : error
end

# @api private
Expand Down

0 comments on commit 5eacdce

Please sign in to comment.