Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create admin using rake task and donot confirm admin #5

Merged
merged 1 commit into from
May 16, 2023

Conversation

agarwalrashika00
Copy link
Owner

No description provided.

@agarwalrashika00 agarwalrashika00 linked an issue May 15, 2023 that may be closed by this pull request
Base automatically changed from users-forgot-password-and-remember-me to users-auth-and-confirm May 16, 2023 11:03
@@ -7,4 +7,8 @@ class User < ApplicationRecord
enum role: { participant: 0, admin: 1 }

validates :first_name, presence: true

def confirmation_required?
role == 'admin' ? false : true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix this

address: "localhost",
port: 1025,
user_name: 'agarwalrashika09',
password: 'bddgzlpccstsxdbw'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to credentials

print "enter password: "
password = STDIN.noecho(&:gets).chomp
u = User.new(first_name: first_name, last_name: last_name, role: 'admin', email: email, password: password)
u.save
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handle error

@agarwalrashika00 agarwalrashika00 force-pushed the create_admin_using_rake_task branch from d249b86 to 6527d4e Compare May 16, 2023 11:45
@Ankita9818 Ankita9818 merged commit ffb196b into users-auth-and-confirm May 16, 2023
@Ankita9818 Ankita9818 deleted the create_admin_using_rake_task branch May 16, 2023 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create admin using rake task and donot confirm admin
2 participants