We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dfeb312 commit 062ff12Copy full SHA for 062ff12
1 file changed
lib/sheltertech/db/fixture_populator.rb
@@ -28,6 +28,7 @@ def self.algolia_deferred_index_update(&block)
28
29
def populate
30
Rails.application.eager_load! # Load all models
31
+ create_users # Create users first
32
create_categories
33
create_resources
34
create_eligibilities
@@ -59,6 +60,16 @@ def featured_categories
59
60
@featured_categories ||= Category.where(featured: true)
61
end
62
63
+ # Create a test user
64
+ def create_users
65
+ user = User.new
66
+ user.name = "Test User"
67
+ user.email = "test@test.com"
68
+ user.organization = "Test Organization"
69
+ user.user_external_id = "test_user_external_id"
70
+ user.save
71
+ end
72
+
73
def create_categories
74
Constants::CATEGORY_NAMES.each { |name| FactoryBot.create(:category, name: name) }
75
Constants::TOP_LEVEL_CATEGORY_NAMES.each do |c|
0 commit comments