Maybe I'm misusing serialized objects, so I apologize in advance. For the activity feed, I use a serialized metadata column to simplify the database call. For instance. for an activity feed, I just deal with Activity objects with the corresponding user_id. I am adding a line_item to the object as shown here:
class Activity < ActiveRecord::Base serialize :data activity = Activity.new(:user_id => user_id...) if activity.source_type == "LineItem" line_item = LineItem.find(activity.source_id) activity.update_attributes(:data => line_item) end
Then I call it through some particles, where the “book” is a bit of metadata:
= link_to image_tag(item.data.book.image_url), book_path(item.data.book.id)
This works fine on my box, but Heroku gives me "TypeError (cannot throw an anonymous class class)". What gives?
source share