You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did a little debuggin on this and journals.last.notes actually references the previous journal update. So it's really looking at whether the update previous to the current one. The one just entered has not yet been saved as a journal, so it doesn't appear in the journals model.
I have this working in my environment. What you want to do, is actually check against the @current_journal object, not the journals model (which only has the journals for previous updates).
Replace the line:
if journals.last.notes.blank?
With the line:
if @current_journal.notes.blank?
And you should be good.
I'd make a patch, but this really seems like a small enough change that it doesn't merrit it.
Probably need to check if there are journals before calling
journals.last.notes
The text was updated successfully, but these errors were encountered: