Preventing URL errors

This commit is contained in:
chiu committed 2026-03-17 09:02:13 +00:00
1 parent c77ee96865
commit 43d1bf2f5e
1 file changed
+6
+6
View File
@@ -6,7 +6,13 @@ class RTemplate
include OrbitCategory::Categorizable
include Slug
before_validation :sanitize_git_url
def sanitize_git_url
return if self.git_url.blank?
self.git_url = self.git_url.strip.gsub(/(\.git|\/)+\z/, '')
end
field :title, as: :slug_title, :localize => true
field :description, :localize => true
field :price, :type => Integer