diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-03 16:36:43 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-03 16:36:43 -0700 |
commit | 40761c4bf39826254b7a5266210f91742591f58c (patch) | |
tree | 2920f9eda1d8a7ec44f2fc5220e540fe39774b17 /activerecord/lib | |
parent | e6583901e58afe58aeb07f1ba1bd9f103492b98b (diff) | |
download | rails-40761c4bf39826254b7a5266210f91742591f58c.tar.gz rails-40761c4bf39826254b7a5266210f91742591f58c.tar.bz2 rails-40761c4bf39826254b7a5266210f91742591f58c.zip |
reduce the number of calls to camelize
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 5458bba51f..3bfd1851b5 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -509,6 +509,7 @@ module ActiveRecord migrations = files.inject([]) do |klasses, file| version, name, scope = file.scan(/([0-9]+)_([_a-z0-9]*)\.?([_a-z0-9]*)?.rb/).first + name = name.camelize raise IllegalMigrationNameError.new(file) unless version version = version.to_i @@ -517,11 +518,11 @@ module ActiveRecord raise DuplicateMigrationVersionError.new(version) end - if klasses.detect { |m| m.name == name.camelize && m.scope == scope } - raise DuplicateMigrationNameError.new(name.camelize) + if klasses.detect { |m| m.name == name && m.scope == scope } + raise DuplicateMigrationNameError.new(name) end - migration = MigrationProxy.new(name.camelize, version, file, scope) + migration = MigrationProxy.new(name, version, file, scope) klasses << migration end |