impressionist
impressionist copied to clipboard
NameError: undefined local variable or method `is_impressionable'
Hi, This gem is great! and it's working fine with rails 4.1.4 and ruby 1.9.3 but, in Rails Console, when I try to instance one new object or try to access one, I got this error msg bellow... NameError: undefined local variable or method `is_impressionable' for Ad (call 'Ad.connection' to establish a connection):Class.
I followed the instructions and put is_impressionable in the Class and impressionist(@ad) in the controller show action.
experiencing the same thing
Also experiencing this problem.
Got the same issue
+1
This seems to still be an issue, from some online research it seems to be related to the loading order, I found some people that has identified the problem arise when you have RailsAdmin gem or other gems that may affect the loading order of the models. http://stackoverflow.com/questions/24183344/conflict-between-rails-admin-and-impressionist-gems I am still looking for a solution since this gem seems to provide the right functionality for a feature I'm trying to add to a project. But it seems is been around for a while already.
After some struggle I got my branch to work, the only thing I needed to add was
class MyModel < ActiveRecord::Base
include Impressionist::IsImpressionable
is_impressionable
end
With this include statement the @widget.impression_count
worked just fine. I also posted the answer on the SO thread I mentioned before. Hope it helps
@oscarsiniscalchi It works. You saved my day.
@oscarsiniscalchi Thanks!
Awesome, this totally helped me too. Thanks!