This project is archived and is in readonly mode.

#1118 ✓wontfix
cuthbert

script/destroy scaffold bug

Reported by cuthbert | September 26th, 2008 @ 07:57 AM | in 2.x

Using Rails 2.1.0 I have observed the following unfortunate behaviour.

The problem is observed when creating more than one model using the scaffold method, then destroying one of them later. Example:

ruby script/generate scaffold Book title:string ruby script/generate scaffold Movie title:string

Now lets say Im editing my Book app, including some edits to the /public/stylesheets/scaffold.css file to make my application look nice.

Lets say now I decide that I dont need the Movie model after all, and delete that by executing:

ruby script/destroy scaffold Movie

Now, in spite of the fact that I still have a model using the .css file, it is deleted by the script. In fact even the entire stylesheets directory is deleted.

I dont think this is a good behaviour of the destroy script.

Comments and changes to this ticket

  • cuthbert

    cuthbert September 26th, 2008 @ 08:01 AM

    Seems my code was a little messed up by the formatting there. Just to let you know, the two ruby script/generate statemtents was intended to be on separate lines.

  • josh

    josh December 20th, 2008 @ 05:29 PM

    • State changed from “new” to “wontfix”

    You should definitely rename the scaffold.css file if you intend to keep it.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages