Remove private variable usage from models

It seems that `@new_record_before_save` as an instance variable has been
present since around 2007 and it wasn't until Rails 5.1 that things were
changed in such a way to make this inaccessible now.
This commit is contained in:
Matt Rogers 2018-11-12 13:23:30 -06:00
parent 78742d15b8
commit 32d267d6cd
No known key found for this signature in database
GPG key ID: 605D017C07EB4316
5 changed files with 4 additions and 22 deletions

View file

@ -146,9 +146,11 @@ module Todos
end
def set_id_by_name(group_type, set, name)
group = set.where(:name => name).first_or_create
group = set.where(:name => name).first_or_initialize
group_is_new = group.new_record?
group.save if group_is_new
@attributes["#{group_type}_id"] = group.id
return group.new_record_before_save?
group_is_new
end
def set_id_by_id_string(group_type, set, id)