Last active
January 7, 2021 15:49
-
-
Save Luiyit/b028d2b1870227dd85036242f6510be0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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