Skip to content

Instantly share code, notes, and snippets.

@krtschmr
Created August 9, 2015 18:33
Show Gist options
  • Save krtschmr/8bdcb2a8f7c3d08ee7b7 to your computer and use it in GitHub Desktop.
Save krtschmr/8bdcb2a8f7c3d08ee7b7 to your computer and use it in GitHub Desktop.
before_validation do
self.site_id = 1
self.username=Devise.friendly_token.first(4)
self.slug = Devise.friendly_token.first(4)
self.email = "#{Devise.friendly_token.first(4)}@ficken.de"
generated_password = Devise.friendly_token.first(8)
self.password = generated_password
self.password_confirmation = generated_password
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment