Skip to content

Instantly share code, notes, and snippets.

@Luiyit
Last active January 7, 2021 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Luiyit/b028d2b1870227dd85036242f6510be0 to your computer and use it in GitHub Desktop.
Save Luiyit/b028d2b1870227dd85036242f6510be0 to your computer and use it in GitHub Desktop.
def create_backend_admin(admin_email, admin_pass)
admin_exist = Admin.find_by(email: admin_email)
if not admin_exist
admin = Admin.create({
email: admin_email,
password: admin_pass,
password_confirmation: admin_pass,
})
pp admin
else
p "Admin already exist"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment