create_custom_attributes 0.5.20 → 0.5.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 00565aac149fe4c1f7a4c336f0f9b0be59a227fc
|
|
4
|
+
data.tar.gz: f6bf78b744a2267b9950936f7668f62d66188e1e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fac803d970c7058b7080975b3b9f36cd2d9737c0e64cc15e4faf000d8ba086dd0e38ea0313ba837885efec24d93e27cfff653cbe22ba716a616c8c6c1a8402c6
|
|
7
|
+
data.tar.gz: 368a4cde2e69000893deccb1fb68e83844baf5ec019b1553058eb6b20c71650b7f88823b9a42bb69bddc8a0b4ba91422d20b90709e707c793d28bb8d466fda0b
|
|
@@ -197,11 +197,9 @@ module CustomAttributes
|
|
|
197
197
|
end
|
|
198
198
|
end
|
|
199
199
|
|
|
200
|
-
def create_slug
|
|
200
|
+
def create_slug
|
|
201
201
|
new_slug = name.strip.gsub(/([^A-Za-z0-9])+/) { '_' }.downcase
|
|
202
202
|
|
|
203
|
-
new_slug = "#{new_slug}_#{iterator}" unless iterator == 0
|
|
204
|
-
new_slug = create_slug(iterator += 1) unless CustomField.where(slug: new_slug).count == 0
|
|
205
203
|
new_slug
|
|
206
204
|
end
|
|
207
205
|
|