Adapt code to work with frozen strings

This commit is contained in:
Luis Ramos
2020-11-24 19:20:30 +00:00
committed by Andy Brett
parent 611de912a8
commit bfd4adbcee
4 changed files with 11 additions and 5 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -1,4 +1,4 @@
# frozen_string_literal: true
# frozen_string_literal: false
require 'spec_helper'
require 'spree/core/product_duplicator'