app/models/phcscriptcdnpro/script/url.rb in phcscriptcdnpro-14.1.0 vs app/models/phcscriptcdnpro/script/url.rb in phcscriptcdnpro-15.0.0

- old
+ new

@@ -3,22 +3,34 @@ # Clean URL Initialize extend FriendlyId # Add Paper Trail - has_paper_trail + has_paper_trail :class_name => 'Phcscriptcdnpro::UrlVersions' - # Model Relationships + # Relationships 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' + # Validation for Form Fields + validates :scripturl, + presence: true + validates :scripturlrelease, + presence: true + + validates :scripturlcdnupdate, + presence: true + # Clean URL Define - friendly_id :id, use: :slugged + friendly_id :phcscriptcdnpro_url_slug, use: [:slugged, :finders] + + # Define for Multiple Records + def phcscriptcdnpro_url_slug + [ + [:scripturl] + ] + end end end