Last active
August 29, 2015 14:07
-
-
Save jsmestad/80822312c3f57876cd85 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ScopeConcern | |
extend ActiveSupport::Concern | |
included do | |
superclass.send(:define_singleton_method, "#{self.model_name.demodulize.underscore}_records") do | |
where(type: "#{self.class.name}") | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment