Skip to content

Instantly share code, notes, and snippets.

@searls
Created December 17, 2020 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save searls/03149b1acc6c4ac2e4437306d3b84c37 to your computer and use it in GitHub Desktop.
Save searls/03149b1acc6c4ac2e4437306d3b84c37 to your computer and use it in GitHub Desktop.

SOLVED. Problem:

Rails 6.1 deprecates this:

errors[:base] << "Assignment #{active_assignment.id} is already active for this agent and this project")

And says to call add, so I did:

errors.add("Assignment #{active_assignment.id} is already active for this agent and this project")

Which "worked" after turning on AD exceptions because the Rails test process would invoke that string as a method and blow up on the default exception setting.

Apparently the API is actually maybe this?

errors.add(:base, "Assignment #{active_assignment.id} is already active for this agent and this project")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment