Skip to content

undefined method 'like'? #2

@jspaper

Description

@jspaper

hi mates,
I include Opinions in my models and add initializers/opinions.rb to configure redis. But it didn't work. did I miss anything?
thanks.

class User < ActiveRecord::Base
  include Opinions::Opinionated
  opinions :like 
end
class Album < ActiveRecord::Base
  include Opinions::Pollable
  opinions :like   
end
Opinions.backend       = Opinions::RedisBackend.new
Opinions.backend.redis = Redis.new(:host => 'localhost', :port => 6379)  

User.first.like(Album.first)

NoMethodError: undefined method 'like' for #< User:0x007f88be72e798 >
from /Users/joshchang/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activemodel-3.2.3/lib/active_model/attribute_methods.rb:407:in 'method_missing'
from /Users/joshchang/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.3/lib/active_record/attribute_methods.rb:148:in 'method_missing'
from (irb):1
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions