diff --git a/lib/generators/active_record/templates/migration.rb b/lib/generators/active_record/templates/migration.rb index f91ab270..a52b6565 100644 --- a/lib/generators/active_record/templates/migration.rb +++ b/lib/generators/active_record/templates/migration.rb @@ -1,6 +1,6 @@ class DeviseCreate<%= table_name.camelize %> < ActiveRecord::Migration <% if ::Rails::VERSION::MAJOR == 3 && ::Rails::VERSION::MINOR >= 1 -%> - def self.change + def change <% else -%> def self.up <% end -%> diff --git a/test/generators/active_record_generator_test.rb b/test/generators/active_record_generator_test.rb index 7bb0b3c7..5193d4f5 100644 --- a/test/generators/active_record_generator_test.rb +++ b/test/generators/active_record_generator_test.rb @@ -20,7 +20,7 @@ if DEVISE_ORM == :active_record with_rails_version :MAJOR => 3, :MINOR => 1 do run_generator %w(monster) assert_file "app/models/monster.rb", /devise/, /attr_accessible (:[a-z_]+(, )?)+/ - assert_migration "db/migrate/devise_create_monsters.rb", /def self\.change/ + assert_migration "db/migrate/devise_create_monsters.rb", /def change/ end end