Closed dvodvo closed 7 years ago
I'm also trying to resolve this issue. Will report back if I find a workaround.
There is a workaround. You can manually log impression in your controller action.
First remove impressionist
from controller (to avoid double logging) and add impressionist(@object)
to the action.
The solution provided by @dsvoba is the official one. Does that not work for you? I'll close this but please reopen if it doesn't work.
Using the standard rails find_page syntax
def find_page @static = Static.find_by_slug!(params[:id]) end
I have attempted in the controller to invoke the id of the object:@staticimpression = Static.find(@static.id) impressionist(@staticimpression)
However this still leads to 0 being registered in the Impression table for the class id. What is the best way to proceed, while wondering whether changing the migration for impressionable_id to string and adding an index would make sense (given slug is unique)...