Created
March 19, 2010 16:19
-
-
Save jms301/337748 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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