activeuuid icon indicating copy to clipboard operation
activeuuid copied to clipboard

Generate uuid after initialize to support validations on id

Open thetamind opened this issue 11 years ago • 4 comments

Generate the uuid during after_initialize instead of before_create as suggested in #6. This enables validation of id or other uuid attributes.

thetamind avatar Nov 05 '12 02:11 thetamind

cool ill take a look at this shortly.

jashmenn avatar Nov 05 '12 20:11 jashmenn

@thetamind - this looks like a good change, however we've changed the way we're testing a bit so the merge fails. Could you update the commit to match the current testing structure? Then I'll merge in the after_initialize change.

jashmenn avatar Nov 07 '12 23:11 jashmenn

Dude, Can you rebase your patch please, or I'll do it )

pyromaniac avatar Jan 19 '13 10:01 pyromaniac

I tried to implement this on top of master, but my specs failed because of after_initialize - reload with fields specified is not working. Also I've recall why I did not do this after_initialize - it is not default AR behavior, the default is to ask for id after_create, so I've make it compatible. I have no any idea, why do you need to validate id before creation.

pyromaniac avatar Jan 29 '13 05:01 pyromaniac