app/models/phcscriptcdnpro/script/url.rb in phcscriptcdnpro-8.0.1 vs app/models/phcscriptcdnpro/script/url.rb in phcscriptcdnpro-8.0.2
- old
+ new
@@ -1,16 +1,21 @@
module Phcscriptcdnpro
class Script::Url < ApplicationRecord
- # Relationships
+ # Clean URL Initialize
+ extend FriendlyId
# Attach to Listings (Nested)
belongs_to :listing, class_name: 'Phcscriptcdnpro::Script::Listing'
# Attach to Version (None Nested)
belongs_to :version, class_name: 'Phcscriptcdnpro::Script::Version'
# Attach to Extension (None Nested)
belongs_to :extension, class_name: 'Phcscriptcdnpro::Script::Extension'
+
+ # Clean URL Define
+ friendly_id :id, use: :slugged
+
end
-end
\ No newline at end of file
+end