mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-01 23:08:49 +01:00
Use a non deprecated method to collect errors
Hash-based access to set an error is deprecated. Use ActiveModel::Errors.add instead. Co-Authored-By: Dan Rice <dnrce@users.noreply.github.com>
This commit is contained in:
parent
1eb892a473
commit
6d81e14b41
1 changed files with 1 additions and 1 deletions
|
|
@ -110,7 +110,7 @@ module Todos
|
|||
end
|
||||
|
||||
def add_errors(model)
|
||||
@errors.each {|e| model.errors[ e[:attribute] ] = e[:message] }
|
||||
@errors.each {|e| model.errors.add(e[:attribute], e[:message]) }
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue