charlotte-ruby/impressionist — Issue #22: Impressionist Not Compatible with Friendly_ID Gem
Author: designium
Created: 2011-12-25 22:16:01+00:00
State: open

I'm using friendly_id gem that converts http://localhost:3000/posts/1 to http://localhost:3000/posts/titile-of-the-post .

I added impressionist to the controller and I also added is_impressionable to the model.

When I try to run @post.impression_count, the app doesn't show impressions.

Running from Rails C, I figured out that the class Impression was not registering impressionable_id: nil.

As you can see here:

irb(main):008:0> Impression.all
Impression Load (0.7ms) SELECT `impressions`.* FROM `impressions`
=> [#, #, #, #, #, #]
irb(main):009:0>

I have issues with Friendly_ID that changes the way Rails 3.1 works, so all the helpers instead of request id from the instance model, it requests whatever slug from that object. I guess friendly_id is sending a string instead of the an id, but I don't know where to change that specific behavior.