1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 15:49:39 +02:00
Maybe/db/seeds.rb
Muhammed Kılıç 595cfeff9a
Update seeds.rb with sample user (#326)
* Update seeds.rb with sample user

Signed-off-by: Muhammed Kılıç <muhammeddkilicc@gmail.com>

* Update create with create_or_find_by

Co-authored-by: Sebastián Caraballo <sebastiancaruy1@gmail.com>
Signed-off-by: Muhammed Kılıç <muhammeddkilicc@gmail.com>

* Update user create with create_or_find_by

Co-authored-by: Sebastián Caraballo <sebastiancaruy1@gmail.com>
Signed-off-by: Muhammed Kılıç <muhammeddkilicc@gmail.com>

* Update seed data

* Update README with seed credentials

---------

Signed-off-by: Muhammed Kılıç <muhammeddkilicc@gmail.com>
Co-authored-by: Sebastián Caraballo <sebastiancaruy1@gmail.com>
2024-02-06 13:24:14 -06:00

17 lines
864 B
Ruby

# This file should ensure the existence of records required to run the application in every environment (production,
# development, test). The code here should be idempotent so that it can be executed at any point in every environment.
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
#
# Example:
#
# ["Action", "Comedy", "Drama", "Horror"].each do |genre_name|
# MovieGenre.find_or_create_by!(name: genre_name)
# end
# Create the default user
family = Family.create_or_find_by!(name: "The Maybe Family")
puts "Family created: #{family.name}"
user = User.create_or_find_by!(
first_name: "Josh", last_name: "Maybe", email: "user@maybe.local",
password: "password", password_confirmation: "password", family_id: family.id)
puts "User created: #{user.email} for family: #{family.name}"