mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix the issue with 'at' in interprise twitter and insgram
This commit is contained in:
committed by
Maikel Linke
parent
0a22a3baa6
commit
5d2a5e63ec
@@ -290,6 +290,14 @@ class Enterprise < ApplicationRecord
|
||||
strip_url self[:linkedin]
|
||||
end
|
||||
|
||||
def twitter
|
||||
correct_social_url self[:twitter]
|
||||
end
|
||||
|
||||
def instagram
|
||||
correct_social_url self[:instagram]
|
||||
end
|
||||
|
||||
def inventory_variants
|
||||
if prefers_product_selection_from_inventory_only?
|
||||
Spree::Variant.visible_for(self)
|
||||
@@ -420,6 +428,10 @@ class Enterprise < ApplicationRecord
|
||||
url&.sub(%r{(https?://)?}, '')
|
||||
end
|
||||
|
||||
def correct_social_url(url)
|
||||
url&.include?("@") ? url.delete!("@") : url
|
||||
end
|
||||
|
||||
def set_unused_address_fields
|
||||
address.firstname = address.lastname = address.phone = address.company = 'unused' if address.present?
|
||||
business_address.first_name = business_address.last_name = 'unused' if business_address.present?
|
||||
|
||||
Reference in New Issue
Block a user