I'm not sure what I'm doing wrong here, I have a file in lib/acts_as_votable.rb
, it's just a votable system for the app.
module ActsAsVotable
end
module ActiveRecord
class Base
class << self
cattr_accessor :votable
def acts_as_votable
has_many :votes, :as => :voteable
end
def votable?
method_defined? :votes
end
end
def votable?
self.class.send(:method_defined?, :votes)
end
end
end
But it seems that the module never loads:
undefined local variable or method `acts_as_votable' for #<Class:0x00000101796d80>
What would be the proper way to load modules?