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

Ticket #9542 (closed defect: wontfix)

Opened 1 year ago

Last modified 1 year ago

[PATCH] [TINY] Migrations don't run if they have uppercase characters in the filename

Reported by: bscofield Assigned to: core
Priority: low Milestone: 1.x
Component: ActiveRecord Version: edge
Severity: normal Keywords: tiny migration
Cc:

Description

Rick DeNatale pointed out this bug here: http://talklikeaduck.denhaven2.com/articles/2007/09/11/conventions-uber-alles

Basically, the issue is that the regex used to determine the migration version and name blows up if your migration has any uppercase characters in the filename.

This patch includes the simple fix and a test.

Attachments

allow_migrations_to_have_uppercase_chars_in_filename.patch (1.6 kB) - added by bscofield on 09/12/07 12:01:44.

Change History

09/12/07 12:01:44 changed by bscofield

  • attachment allow_migrations_to_have_uppercase_chars_in_filename.patch added.

09/12/07 17:26:32 changed by evan

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

This violates the classname-to-filename roundtrip that Rails assumes almost everywhere.

# bad
>> "create_LEG_frammis_table".camelize.underscore
=> "create_leg_frammis_table"

# good
>> "create_leg_frammis_table".camelize
=> "CreateLegFrammisTable"
>> "CreateLegFrammisTable".underscore
=> "create_leg_frammis_table"

Not a good idea to change it.