Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #751 (closed enhancement: duplicate)

Opened 4 years ago

Last modified 3 years ago

Private methods should be documented somewhere

Reported by: nzkoz Assigned to: David
Priority: normal Milestone: 1.0
Component: ActiveRecord Version: 0.10.0
Severity: normal Keywords: documentation
Cc:

Description

A common mistake that rails beginners make is to create an action 'send' or a model with an attribute 'open'. This often leads to extremely confusing stacktraces.

We need a list of all these 'reserved words' included in the rails documentation so we can help newbies avoid this common mistake.

Change History

02/28/05 09:36:45 changed by anonymous

  • severity changed from normal to enhancement.

02/28/05 20:54:03 changed by bitserf@gmail.com

for #send, we should be doing this instead:

obj.__send__(name, args)

03/22/05 22:39:18 changed by jonathan@relativepath.org

  • priority changed from normal to lowest.

This newbie was bitten by "process" as an action name. The stacktraces are indeed confusing. This error was thrown: "wrong number of arguments (2 for 0)" (which I include for google's sake and the sake of fellow newbies).

04/12/05 02:06:51 changed by nzkoz

  • priority changed from lowest to normal.

This is a fairly prevalent problem with rails newbies, active record, action pack and others all suffer from this.

04/16/05 02:44:47 changed by Michael Schubert <michael@schubert.cx>

You'll also get problems trying to use fields in your tables that are object methods... like "type" there is also the case of @model.id causing a warning to be thrown but I think thats already in a report somewhere

06/22/05 16:22:26 changed by michael@schubert.cx

Some (all?) of this is documented in the Wiki:

http://wiki.rubyonrails.com/rails/show/Gotcha

"Names You Can’t Use (aka reserved words, keywords)"

07/09/05 05:12:02 changed by bitsweat

  • keywords set to documentation.

I think the wiki page is sufficient documentation. Perhaps we should link to it someplace in the rdoc? Suggestions?

11/15/05 09:24:38 changed by bitsweat

  • status changed from new to closed.
  • resolution set to duplicate.

Docs don't cut it. This causes too many stubbed toes. Superseded by #752.

11/15/05 18:21:27 changed by nzkoz

I agree that docs don't cut it, but until the fix for 752 is applied, I think we should aim to have it documented somewhere. I agree that the link to the wiki should be enough though.