Skip to content

Generate uuid after initialize to support validations on id #16

Open
wants to merge 2 commits into from

3 participants

@thetamind

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

@jashmenn
Owner
jashmenn commented Nov 5, 2012

cool ill take a look at this shortly.

@jashmenn
Owner
jashmenn commented Nov 7, 2012

@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.

@pyromaniac
Collaborator

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

@pyromaniac
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.