This project is archived and is in readonly mode.
add a check for reserved words in generators
-
CancelProfileIsBroken
- State changed from new to incomplete
If you're motivated to do this, please send along a patch. But note that in Rails 3.0, the plan is to make the generators able to handle various combinations of ORM/Testing Library/Javascript library (at least), so the issue of figuring out what the reserved words are becomes practically impossible.
-
kirillrdy
Hi, I am willing to implement it myself.
I know full protection will be hard to implement, but lets start with something simple, like Model names and properties (database fields)
I foolishly created(scaffolded) a model with string property "action" on it. It was really hard to find why "update" didn't work. it was posting My model's hash :action => {fields}, and overwrote rail's params[:action].
Wasn't easy to find.(no helpful error message or anything)
For first, at least have a blacklist of Model names (eg File) and fields (eg Action).
I haven't been following rails 3.0 development. But I will try to put some time into this soon.
Thanks,
Kirill R
-
José Valim
- State changed from incomplete to invalid
He already check for class collisions in both Rails 2.3 stable and master. For instance, you cannot create a model named File.
I cannot reproduce the update behavior, because the model action is available at params[:model][:action] and not params[:action]. A couple of keywords are already checked on migrations too.
-
Evgeniy Dolzhenko
He already check for class collisions in both Rails 2.3 stable and master. For instance, you cannot create a model named File.
I failed to quickly find the code which does that, could you please find a link?