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

- old
+ new

@@ -3,16 +3,33 @@ # Clean URL Initialize extend FriendlyId # Add Paper Trail - has_paper_trail + has_paper_trail :class_name => 'Phcscriptcdnpro::ExtensionVersions' - # Model Relationships + # Relationships has_many :listings, class_name: 'Phcscriptcdnpro::Script::Listing', :through => :urls has_many :urls, class_name: 'Phcscriptcdnpro::Script::Url' + # Validation for Form Fields + validates :scriptextensionname, + presence: true + + validates :scriptextensiondes, + presence: true + + validates :scriptextension, + presence: true + # Clean URL Define - friendly_id :scriptextensionname, use: :slugged + friendly_id :phcscriptcdnpro_extentension_slug, use: [:slugged, :finders] + + # Define for Multiple Records + def phcscriptcdnpro_extentension_slug + [ + [:scriptextensionname, :scriptextension] + ] + end end end