Skip to content

fix: skip seeds when running in production environment#832

Open
rewritten wants to merge 2 commits intocoopdevs:developfrom
rewritten:fix/828-skip-seeds-in-production
Open

fix: skip seeds when running in production environment#832
rewritten wants to merge 2 commits intocoopdevs:developfrom
rewritten:fix/828-skip-seeds-in-production

Conversation

@rewritten
Copy link
Contributor

Summary

  • Adds an early-exit guard to db/seeds.rb so seeds are never loaded when RAILS_ENV=production
  • Fixes the issue where bundle exec rails db:setup in Docker would unconditionally load development/demo data into production databases

Closes #828

Test plan

  • Run RAILS_ENV=production rails db:setup and confirm the seed data is not loaded
  • Run RAILS_ENV=development rails db:setup and confirm seeds still load normally

🤖 Generated with Claude Code

…s#828)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 26, 2026 12:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a guard to prevent seed data from being loaded when running Rails in a production environment, addressing Docker-based db:setup runs that were unintentionally populating production databases with development/demo data (Closes #828).

Changes:

  • Introduces an early production-environment check in db/seeds.rb to skip seeding when Rails.env.production?.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

Do not always load db/seeds.rb

2 participants