-
-
Save dabit/7f953a3e7ef6375c92edb2b5b0033011 to your computer and use it in GitHub Desktop.
Trucos para desarrolladores
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
raise if Rails.env.production? | |
unless User.exists?(email: 'test@example.com') | |
organization = Organization.create!(name: 'Acme Inc', token: '12341234a') | |
user = User.create!( | |
email: 'test@example.com', | |
password: 'test123test', | |
role: :admin, | |
confirmed_at: Time.current, | |
organization: organization | |
) | |
10.times do |i| | |
user = organization.users.build( | |
email: Faker::Internet.email, | |
password: 'test123test', | |
role: :user | |
) | |
user.save! | |
work_profile = WorkProfile.new(full_name: Faker::Name.name, | |
start_date: (rand(30) + 30).days.ago, | |
user: user) | |
work_profile.save! | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment