mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-11 18:04:22 +01:00
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:
parent
78742d15b8
commit
32d267d6cd
5 changed files with 4 additions and 22 deletions
|
|
@ -45,10 +45,6 @@ class Context < ApplicationRecord
|
|||
name
|
||||
end
|
||||
|
||||
def new_record_before_save?
|
||||
@new_record_before_save
|
||||
end
|
||||
|
||||
def no_active_todos?
|
||||
return todos.active.count == 0
|
||||
end
|
||||
|
|
|
|||
|
|
@ -118,10 +118,6 @@ class Project < ApplicationRecord
|
|||
end
|
||||
end
|
||||
|
||||
def new_record_before_save?
|
||||
@new_record_before_save
|
||||
end
|
||||
|
||||
def age_in_days
|
||||
@age_in_days ||= (Time.current.to_date - created_at.to_date).to_i + 1
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue