Generating RDoc for App

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

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. [email protected]
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 [email protected].
To unsubscribe from this group, send email to
[email protected][email protected]
.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


Cheers,
Bala
RoR Developer Now Available for Hire

Bala P. wrote:

Even IDE s have problem with named_scopes.

Who cares about IDEs? :slight_smile: 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
[email protected]

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

===

On Wed, Jul 21, 2010 at 1:21 PM, Marnen Laibow-Koser
[email protected] 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

Bill W. wrote:

On Wed, Jul 21, 2010 at 1:21 PM, Marnen Laibow-Koser
[email protected] 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 . 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
[email protected]