Created
June 17, 2015 17:37
-
-
Save rserna2010/5f5faadcf6d40c1dd7b2 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 SurveyorExtension | |
extend ActiveSupport::Concern | |
# add your instance methods here | |
def foo | |
"foo" | |
end | |
# add your static(class) methods here | |
module ClassMethods | |
#E.g: Order.top_ten | |
def top_ten | |
limit(10) | |
end | |
end | |
end | |
# include the extension | |
ActiveRecord::Base.send(:include, SurveyorExtension) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment