I want to DRY up several models by moving shared scopes into a module, something like:
module CommonScopes
extend ActiveSupport::Concern
module ClassMethods
scope :ordered_for_display, order("#{self.to_s.tableize}.rank asc")
end
end
I also want to create shared specs that test the module. Unfortunately when I try to include the shared scope in my model I get:
undefined method `order' for CommonScopes::ClassMethods:Module
Any ideas? Thanks!