Skip to content

Instantly share code, notes, and snippets.

@jms301
Created March 19, 2010 16:19
Show Gist options
  • Save jms301/337748 to your computer and use it in GitHub Desktop.
Save jms301/337748 to your computer and use it in GitHub Desktop.
module ActsAsVotable
def self.included(base)
base.extend(ClassMethods)
end
ActiveRecord::Base.send(:include, ActsAsVotable)
end
module ClassMethods
def acts_as_votable
send :include, InstanceMethods
end
end
module InstanceMethods
def vote_cancel user
#do lots of stuff I want to appear in my models
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment