Specifying a named scope in a mixin?

I would like to specify a named scope in a Module, to keep DRY. Example:

class Article < < ActiveRecord::Base

include ReferenceData

end

module ReferenceData

def self.included(base)
base.extend(ClassMethods)
end

module ClassMethods

named_scope :released,    :conditions => {:is_released => true}

end

end

This does not work:

Article.released
NoMethodError: undefined method `named_scope’ for
ReferenceData::ClassMethods:Module

Do you know how to specify my named scope inside a mixin module?
Thanks a lot,
Ewald

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs