mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-28 01:53:25 +00:00
Adapt code to work with frozen strings
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'open_food_network/locking'
|
||||
require 'open_food_network/permalink_generator'
|
||||
require 'spree/core/s3_support'
|
||||
@@ -66,10 +68,10 @@ class EnterpriseGroup < ActiveRecord::Base
|
||||
def unset_undefined_address_fields
|
||||
return if address.blank?
|
||||
|
||||
address.phone.sub!(/^#{I18n.t(:undefined)}$/, '')
|
||||
address.address1.sub!(/^#{I18n.t(:undefined)}$/, '')
|
||||
address.city.sub!(/^#{I18n.t(:undefined)}$/, '')
|
||||
address.zipcode.sub!(/^#{I18n.t(:undefined)}$/, '')
|
||||
address.phone = address.phone.sub(/^#{I18n.t(:undefined)}$/, '')
|
||||
address.address1 = address.address1.sub(/^#{I18n.t(:undefined)}$/, '')
|
||||
address.city = address.city.sub(/^#{I18n.t(:undefined)}$/, '')
|
||||
address.zipcode = address.zipcode.sub(/^#{I18n.t(:undefined)}$/, '')
|
||||
end
|
||||
|
||||
def to_param
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module OpenFoodNetwork::Locking
|
||||
# http://rhnh.net/2010/06/30/acts-as-list-will-break-in-production
|
||||
def with_isolation_level_serializable
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Finds a unique permalink for a new or updated record.
|
||||
# It considers soft-deleted records which are ignored by Spree.
|
||||
# Spree's work:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
# frozen_string_literal: false
|
||||
|
||||
require 'spec_helper'
|
||||
require 'spree/core/product_duplicator'
|
||||
|
||||
Reference in New Issue
Block a user