Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fixed ActiveRecord::StatementInvalid: Could not find table 'spree_stores'

Damian Legawiec0f61ee13f0fb
diff --git a/core/app/models/spree/store.rb b/core/app/models/spree/store.rb
index b5713f0564..cdc85ceea7 100644
--- a/core/app/models/spree/store.rb
+++ b/core/app/models/spree/store.rb
@@ -8,7 +8,10 @@ module Spree
validates :name, :url, :mail_from_address, :default_currency
end
- connection.column_exists?(:spree_stores, :new_order_notifications_email) do
+ if !ENV['SPREE_DISABLE_DB_CONNECTION'] &&
+ connected? &&
+ table_exists? &&
+ connection.column_exists?(:spree_stores, :new_order_notifications_email)
validates :new_order_notifications_email, email: { allow_blank: true }
end