
[dm-constraints] should not migrate constraints for remixable modules
Reported by Martin Gamsjaeger (snusnu) | July 7th, 2009 @ 09:43 PM | in 0.10.0
The following will currently try to migrate fk constraints for the linkables table which never exists because Linkable is only a remixable module and not a real model.
I added a fix for this in my fork at
http://github.com/snusnu/dm-more/commit/c02c4d744e22fc22d546ef899e1...
module Linkable
include DataMapper::Resource
is :remixable
# properties
property :id, Serial
property :via, Integer
property :by, Integer
# associations
belongs_to :via, 'Link', :source_key => [ :via ]
belongs_to :by, 'User', :source_key => [ :by ]
end
class Project
include DataMapper::Resource
# ...
remix n, :linkables,
:as => :references,
:model => 'ProjectReference',
:for => 'Link'
end
Comments and changes to this ticket
-
Martin Gamsjaeger (snusnu) July 7th, 2009 @ 09:44 PM
- State changed from unconfirmed to accepted
- Tag changed from dm-constraints, dm-is-remixable to dm-constraints, dm-is-remixable
-
Dan Kubb (dkubb) July 10th, 2009 @ 01:20 PM
- State changed from accepted to resolved
(from [7d041c22b921228686b0dbd8c6c077ec0b68ffa6]) [dm-constraints] don't migrate constraints for remixable modules
-
Since remixable modules need to include DataMapper::Resource, dm-constraints tried to migrate constraints for the module and not the generated model. However, there is no storage for the module and so the constraint migration used to fail.
-
Also, I noticed that currently 36 out of the 94 specs for dm-constraints fail all with the same message (at least on my machine)
constant Object::Article not defined ../spec_helper.rb:42:in
remove_const'
This happens with or without this patch.
[#961 state:resolved] http://github.com/datamapper/dm-more/commit/7d041c22b921228686b0dbd...
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
Referenced by
-
961 [dm-constraints] should not migrate constraints for remixable modules [#961 state:resolved] http://github.com/datamapper/dm-mo...