#961 ✓resolved
Martin Gamsjaeger (snusnu)

[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

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