# Generating RDoc for App

**URL:** <https://www.ruby-forum.com/t/generating-rdoc-for-app/191972>\
**Category:** Rails\
**Created:** [July 21, 2010, 4:23pm UTC](https://www.ruby-forum.com/t/generating-rdoc-for-app/191972 "2010-07-21T16:23:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![willclarkdesigns](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/85f322/32.png) [@willclarkdesigns](https://www.ruby-forum.com/u/willclarkdesigns)\
**Post date:** [July 21, 2010, 4:23pm UTC](https://www.ruby-forum.com/t/generating-rdoc-for-app/191972/1 "2010-07-21T16:23:51Z")

</div>

I notice that when I run rake doc:app, that the named\_scope declarations  
I have in my models aren’t being included in the documentation.

Is there a way to get named\_scopes in the rdocs?

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![willclarkdesigns](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/85f322/32.png) [@willclarkdesigns](https://www.ruby-forum.com/u/willclarkdesigns)\
**Post date:** [July 21, 2010, 7:54pm UTC](https://www.ruby-forum.com/t/generating-rdoc-for-app/191972/2 "2010-07-21T19:54:05Z")

</div>

Even IDE s have problem with named\_scopes. I don’t think RDoc can  
recognize  
it. Besides looking like a train wreck, that’s one of the reason I don’t  
like named\_scopes.

On Wed, Jul 21, 2010 at 7:23 AM, Will C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> –  
> You received this message because you are subscribed to the Google G.  
> “Ruby on Rails: Talk” group.  
> To post to this group, send email to removed\_email\_address@domain.invalid.  
> To unsubscribe from this group, send email to  
> removed\_email\_address@domain.invalid[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> .  
> For more options, visit this group at  
> [http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

–  
Cheers,  
Bala  
RoR Developer Now Available for Hire

---

<div class="post-metadata">

**Author:** ![willclarkdesigns](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/85f322/32.png) [@willclarkdesigns](https://www.ruby-forum.com/u/willclarkdesigns)\
**Post date:** [July 21, 2010, 8:21pm UTC](https://www.ruby-forum.com/t/generating-rdoc-for-app/191972/3 "2010-07-21T20:21:23Z")

</div>

Bala P. wrote:

> Even IDE s have problem with named\_scopes.

Who cares about IDEs? 🙂 No IDE that I’m aware of really works well  
with Ruby’s dynamic features. IMHO, that’s a reason to not use an IDE  
for Ruby.

> I don’t think RDoc can  
> recognize  
> it.

I think you’re right, but it wouldn’t be hard to patch RDoc to recognize  
it if you want to.

> Besides looking like a train wreck, that’s one of the reason I don’t  
> like named\_scopes.

Those are bad reasons to dislike named\_scope, frankly. I don’t think  
the syntax is at all bad, and using a named\_scope makes most of the rest  
of your code _not_ look like a trainwreck. I’ll take a named\_scope over  
the old way of doing it any day.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![willclarkdesigns](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/85f322/32.png) [@willclarkdesigns](https://www.ruby-forum.com/u/willclarkdesigns)\
**Post date:** [July 21, 2010, 11:56pm UTC](https://www.ruby-forum.com/t/generating-rdoc-for-app/191972/4 "2010-07-21T23:56:42Z")

</div>

For anyone interested, I emailed Eric H. who mentioned that it is  
possible:

===

You’ll need ## above your comment like:

# This is the test model

class Test \< ActiveRecord::Base

## 

# Sort all tests by name

named\_scope :sort\_by\_name, :order =\> “name ASC”  
end

See ‘Metaprogrammed Methods’ here:

[http://rdoc.rubyforge.org/RDoc/Parser/Ruby.html](http://rdoc.rubyforge.org/RDoc/Parser/Ruby.html)

===

---

<div class="post-metadata">

**Author:** ![willclarkdesigns](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/85f322/32.png) [@willclarkdesigns](https://www.ruby-forum.com/u/willclarkdesigns)\
**Post date:** [July 21, 2010, 8:43pm UTC](https://www.ruby-forum.com/t/generating-rdoc-for-app/191972/5 "2010-07-21T20:43:16Z")

</div>

On Wed, Jul 21, 2010 at 1:21 PM, Marnen Laibow-Koser  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I think you’re right, but it wouldn’t be hard to patch RDoc to recognize  
> it if you want to.

Code, as opposed to unsubstantiated assertions, would be much more  
credible.

Bill

---

<div class="post-metadata">

**Author:** ![willclarkdesigns](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/85f322/32.png) [@willclarkdesigns](https://www.ruby-forum.com/u/willclarkdesigns)\
**Post date:** [July 22, 2010, 12:48am UTC](https://www.ruby-forum.com/t/generating-rdoc-for-app/191972/6 "2010-07-22T00:48:51Z")

</div>

Bill W. wrote:

> On Wed, Jul 21, 2010 at 1:21 PM, Marnen Laibow-Koser  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I think you’re right, but it wouldn’t be hard to patch RDoc to recognize  
> > it if you want to.
> 
> Code, as opposed to unsubstantiated assertions, would be much more  
> credible.

The OP’s problem isn’t mine, so I’m not going to spend the time writing  
that code. I was just trying to remind him that it’s feasible if he  
wants to do it. No more, no less.

In any case, it seems that a patch isn’t necessary, based on the feature  
mentioned in [Generating RDoc for App - Rails - Ruby-Forum](http://www.ruby-forum.com/topic/213558#927241) . I’m happy  
to know about that feature, and I will probably use it a great deal.

> Bill

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
