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.

Remove globalize references

Rafal Cymerys625758b7e3e9
diff --git a/core/app/validators/db_maximum_length_validator.rb b/core/app/validators/db_maximum_length_validator.rb
index 67a2b3e535..e811c82609 100644
--- a/core/app/validators/db_maximum_length_validator.rb
+++ b/core/app/validators/db_maximum_length_validator.rb
@@ -7,11 +7,7 @@ class DbMaximumLengthValidator < ActiveModel::EachValidator
Please remove any `db_maximum_length: true` validations from your codebase
DEPRECATION
- limit = if defined?(Globalize)
- record.class.translation_class.columns_hash[attribute.to_s].limit
- else
- record.class.columns_hash[attribute.to_s].limit
- end
+ limit = record.class.columns_hash[attribute.to_s].limit
value = record[attribute.to_sym]
if value && limit && value.to_s.length > limit
record.errors.add(attribute.to_sym, :too_long, count: limit)