
DataMapper.auto_migrate! doesn't call for custom (overwritten) automigrations
Reported by Dawid Marcin Grzesiak | March 26th, 2010 @ 01:05 PM | in 1.0.0
It should print XXXXXXXX on the screen:
require 'dm-core'
# setup the logger
DataMapper::Logger.new(STDOUT, :debug)
# connect to the DB
DataMapper.setup(:default, 'sqlite3::memory:')
class Person
include DataMapper::Resource
# properties
property :id, Serial
def self.auto_migrate!
puts "XXXXXXXX"
super
end
end
DataMapper.auto_migrate!
Comments and changes to this ticket
-
Dawid Marcin Grzesiak March 26th, 2010 @ 02:56 PM
- Title changed from DataMapper.auto_migrate! doesn't call for custom (overriden) automigrations to DataMapper.auto_migrate! doesn't call for custom (overwritten) automigrations
-
Martin Gamsjaeger (snusnu) March 26th, 2010 @ 02:58 PM
- State changed from new to confirmed
- Assigned user set to Martin Gamsjaeger (snusnu)
- Title changed from DataMapper.auto_migrate! doesn't call for custom (overwritten) automigrations to DataMapper.auto_migrate! doesn't call for custom (overriden) automigrations
- Milestone set to 1.0.0
-
Dawid Marcin Grzesiak March 26th, 2010 @ 03:41 PM
- Title changed from DataMapper.auto_migrate! doesn't call for custom (overriden) automigrations to DataMapper.auto_migrate! doesn't call for custom (overwritten) automigrations
-
Martin Gamsjaeger (snusnu) March 27th, 2010 @ 01:59 PM
- State changed from confirmed to accepted
Standalone script with a monkey patch to fix this issue: http://pastie.org/889918
-
Dan Kubb (dkubb) March 27th, 2010 @ 02:16 PM
- State changed from accepted to resolved
(from [547627dde7bbd731eacb6c2d2f1ca623d79dcb3a]) Allow to properly overwrite Model.auto_migrate!
Previously, calling DataMapper.auto_migrate! did
not call .auto_migrate! on all models descendants.
Instead, it calledauto_migrate_down!(repository_name) auto_migrate_up!(repository_name)
explicitly. With this change, these 2 methods will
still be called by .auto_migrate! but because the
auto_migrate! method is now used to invoke the other
2, it's now possible to truly overwrite it.[#1225 state:resolved] http://github.com/datamapper/dm-core/commit/547627dde7bbd731eacb6c2...
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.
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
Tags
Referenced by
-
1225 DataMapper.auto_migrate! doesn't call for custom (overwritten) automigrations [#1225 state:resolved] http://github.com/datamapper/dm-c...