diff --git a/padrino-gen/lib/padrino-gen/generators/components/orms/datamapper.rb b/padrino-gen/lib/padrino-gen/generators/components/orms/datamapper.rb index 94f465b8a..3c516878d 100644 --- a/padrino-gen/lib/padrino-gen/generators/components/orms/datamapper.rb +++ b/padrino-gen/lib/padrino-gen/generators/components/orms/datamapper.rb @@ -100,7 +100,7 @@ def create_model_file(name, options={}) def create_model_migration(migration_name, name, columns) output_model_migration(migration_name, name, columns, - :column_format => Proc.new { |field, kind| "column :#{field}, #{kind.classify}#{', :length => 255' if kind =~ /string/i}" }, + :column_format => Proc.new { |field, kind| "column :#{field}, DataMapper::Property::#{kind.classify}#{', :length => 255' if kind =~ /string/i}" }, :base => DM_MIGRATION, :up => DM_MODEL_UP_MG, :down => DM_MODEL_DOWN_MG) end diff --git a/padrino-gen/test/test_model_generator.rb b/padrino-gen/test/test_model_generator.rb index b9fb8a084..068c3d10d 100644 --- a/padrino-gen/test/test_model_generator.rb +++ b/padrino-gen/test/test_model_generator.rb @@ -233,9 +233,9 @@ def teardown migration_file_path = "#{@apptmp}/sample_project/db/migrate/001_create_people.rb" assert_match_in_file(/migration 1, :create_people do/m, migration_file_path) assert_match_in_file(/create_table :people do/m, migration_file_path) - assert_match_in_file(/column :name, String/m, migration_file_path) - assert_match_in_file(/column :created_at, DateTime/m, migration_file_path) - assert_match_in_file(/column :email, String/m, migration_file_path) + assert_match_in_file(/column :name, DataMapper::Property::String/m, migration_file_path) + assert_match_in_file(/column :created_at, DataMapper::Property::DateTime/m, migration_file_path) + assert_match_in_file(/column :email, DataMapper::Property::String/m, migration_file_path) assert_match_in_file(/drop_table :people/m, migration_file_path) end end