This project is archived and is in readonly mode.
[PATCH] plural names generate a constant error
-
John Pignata
+1 Verified -- it appears to be an issue where the assign_names! method is called during initialize but never reset in the event that the model name was plural. My patch resets assign_names! in this case and added an assertion.
-
John Pignata
- Assigned user set to José Valim
- Tag changed from auto, const, error, generated, plural, scaffold to 2-3-stable, auto, const, error, generated, master, plural, scaffold
- Title changed from plural names generate a constant error to [PATCH] plural names generate a constant error
Here's a patch for master. Currently, plural names passed as models to the scaffold generator in master don't generate any files but instead crashes due to a related bug.
-
Kane
why do you think this should work?
"Pass the name of the model (in singular form), either CamelCased or under_scored, as the first argument, and an optional list of attribute pairs."
-
John Pignata
There's code in the generator now to handle the case when a plural name is passed - though it reports that it's reverting to singular it's simply not working:
jp@populuxe:~/Projects/scratch/test_scaffold$ script/generate scaffold cars warning Plural version of the model detected, using singularized version. Override with --force-plural. -
Kane
okey
-
José Valim
- Assigned user changed from José Valim to Jeremy Kemper
Fixed on master, must be merged soon. Just need to apply the patch in 2.3 stable.
-
Repository
(from [0efedf2a30a12cdaa261556e3684c630690afe0f]) Ensure scaffold works properly even if plural name is given. [#3062 [PATCH] plural names generate a constant error] http://github.com/rails/rails/commit/0efedf2a30a12cdaa261556e3684c6...
-
Repository
- State changed from new to committed
(from [ff8cb50f25e426c531743fbf918e2a870e60e0e8]) Ensuring that a singular model name is set for use in controllers when scaffold is passed a plural model name
[#3062 [PATCH] plural names generate a constant error state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/ff8cb50f25e426c531743fbf918e2a...
