Open tillcarlos opened 4 years ago
Hi, Experience the same Error. I tried this workaround. But I still get an error in my production environment on Heroku. (it works fine on my local server)
Any ideas on how I can resolve this? Here's what I get back from my Heroku Logs.
[9972b504-118f-45f9-Completed 500 Internal Server Error in 128ms (ActiveRecord: 36.2ms | Allocations: 14844)
ActionView::Template::Error (undefined method `with_indifferent_access' for "{}":String):
<div class="grid md:grid-cols-12 md:mr-12 my-5 md:ml-24">
<% @activities.each do |activity| %>
<% activity.parameters ||= {} %>
<%= render_activities(activity) %>
<% end %>
</div>
Hey guys. First: great work! This is exactly the gem I was searching for.
On my dev+production machine sometimes activities get created with parameters being nil.
Then this code fails
with_indifferent_access called on
nil
object.I'm fixing it in the view with this:
But it's weird that it's necessary. Maybe because I changed my migration to
t.json "parameters"
? Default was text, but that crashed on my production machine (a vanilla dokku install... I did not check why text did not work, but json worked. If it's relevant I can investigate).Wouldn't it make sense to just put in the default? Or change that method to always hand out at least empty hash?
{}