-
Hi My controller function looks like this
I get the following error in the logs (TeamUser is a model in my application)
I think when it tries to render activities which are notifications, there are associated records that have been previously deleted that it can't find. I look in the documentation and tried adding the following which unfortunately had no effect.
I'm trying also to catch the exception using "rescue_from" but then I don't see any notifications. Do you have any suggestions on how to handle this better? Any advice appreciated Tri |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Of course when I ask the question I figure out the answer There is probably a more efficient way to do this and I still need to clean out the database of stale entries which I could use help with
|
Beta Was this translation helpful? Give feedback.
-
I'd also recommend using the association helper so you notifications are destroyed when an associated object is destroyed. |
Beta Was this translation helpful? Give feedback.
Of course when I ask the question I figure out the answer
What I do is I run .to_json on each notification
For notifications that trigger an exception I don't add that to a new list I'm creating
I return that new filtered list
There is probably a more efficient way to do this and I still need to clean out the database of stale entries which I could use help with