
dm-is-versioned with discriminator data types
Reported by ash.gti | June 20th, 2009 @ 01:26 PM | in 0.10.0
When you add a discriminator data type to any model that 'is-vereioned' then it will result in an error. Simply add a property to the spec Story class included in the dm-is-versioned class and run the spec you'll get the errors I am talking about. They will look something like:
DataObjects::IntegrityError in 'DataMapper::Is::Versioned#save
(with a dirty existing resource) should create a versioned
copy'
PRIMARY KEY must be unique
I am trying to figure out why this happens, but I don't think this is intended. If is-versioned is not supposed to work with discriminator data types thats fine but it should be specified in the documentation somewhere.
Comments and changes to this ticket
-
ash.gti June 20th, 2009 @ 01:29 PM
- Tag set to discriminator, dm-is-versioned
-
Dan Kubb (dkubb) July 16th, 2009 @ 01:04 PM
- Assigned user set to Dan Kubb (dkubb)
- State changed from new to accepted
-
ash.gti July 26th, 2009 @ 03:49 PM
Currently, if you run the tests you'll have them all pass. If you apply this patch and re-run the tests you'll have 4 tests fail, the main error is:
DataObjects::IntegrityError in 'DataMapper::Is::Versioned#versions should not return another object's versions' PRIMARY KEY must be unique /path/to/dm-more/dm-is-versioned/lib/dm-is-versioned/is/versioned.rb:69:in `__hooks_after__update_0' /path/to/dm-more/dm-is-versioned/spec/versioned_spec.rb:83:
-
-
Dan Kubb (dkubb) August 15th, 2009 @ 04:06 AM
- State changed from accepted to resolved
(from [acf7a8a2e7de184895921066757b8a03b47bafc7]) [dm-is-versioned] Updated versioning to work with Module using STI
[#914 state:resolved] http://github.com/datamapper/dm-more/commit/acf7a8a2e7de18489592106...
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
Attachments
Referenced by
-
914 dm-is-versioned with discriminator data types [#914 state:resolved] http://github.com/datamapper/dm-mo...