#1303 ✓resolved
Postmodern

DataMapper should check the class name before migrating.

Reported by Postmodern | June 4th, 2010 @ 05:10 PM

I noticed that DataMapper will accept empty class-name when migrating:

require 'dm-core'
require 'dm-migrations'

model = Class.new
model.class_eval do

  include DataMapper::Resource
  include DataMapper::Migrations

  property :id, Serial

end

DataMapper::Logger.new(STDOUT,:debug)
DataMapper.setup(:default, 'sqlite3:/tmp/test.db')
DataMapper.auto_migrate!
 ~ (0.000109) SELECT sqlite_version(*)
 ~ (0.000337) DROP TABLE IF EXISTS ""
 ~ (0.000053) PRAGMA table_info("")
 ~ (0.086799) CREATE TABLE "" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT)

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

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

People watching this ticket

Referenced by

Pages