# Specifying a named scope in a mixin?

**URL:** <https://www.ruby-forum.com/t/specifying-a-named-scope-in-a-mixin/182021>\
**Category:** Rails\
**Created:** [January 21, 2010, 6:10pm UTC](https://www.ruby-forum.com/t/specifying-a-named-scope-in-a-mixin/182021 "2010-01-21T18:10:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ewaldkoenig](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/9d8465/32.png) [@ewaldkoenig](https://www.ruby-forum.com/u/ewaldkoenig)\
**Post date:** [January 21, 2010, 6:10pm UTC](https://www.ruby-forum.com/t/specifying-a-named-scope-in-a-mixin/182021/1 "2010-01-21T18:10:48Z")

</div>

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
