Skip to content

Commit

Permalink
Allow seeding in production with environment variable adjustment (#581)
Browse files Browse the repository at this point in the history
* &

* allow seeding in prod with env var

* def false

* better msg
  • Loading branch information
thatguyinabeanie authored Dec 12, 2024
1 parent 9d367ac commit e37a4bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# config.action_cable.mount_path = nil
config.action_cable.url = ENV["ACTION_CABLE_URL"]

config.action_cable.allowed_request_origins = ENV["ACTION_CABLE_ALLOWED_ORIGINS"].split(",")
config.action_cable.allowed_request_origins = ENV["ACTION_CABLE_ALLOWED_ORIGINS"]&.split(",")

# Assume all access to the app is happening through a SSL-terminating reverse proxy.
# Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
Expand Down
9 changes: 2 additions & 7 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@

require "faker"

if Rails.env.production?
puts("Seeding is disabled in production.")
exit
end

if ENV.fetch("SKIP_SEEDS", false) == "true"
puts("Skipping seeding data.")
if ENV.fetch("SKIP_SEEDS", "false") == "true"
puts("Skip seeding. Exiting...")
exit
end

Expand Down

0 comments on commit e37a4bc

Please sign in to comment.