app/models/spotlight/exhibit.rb in blacklight-spotlight-0.14.1 vs app/models/spotlight/exhibit.rb in blacklight-spotlight-0.14.2
- old
+ new
@@ -10,10 +10,11 @@
scope :unpublished, -> { where(published: false) }
extend FriendlyId
friendly_id :title, use: [:slugged, :finders]
validates :title, presence: true
+ validates :slug, uniqueness: true
default_scope { order('weight ASC') }
acts_as_tagger
delegate :blacklight_config, to: :blacklight_configuration
@@ -53,11 +54,9 @@
before_create :add_site_reference
after_create :initialize_config
after_create :initialize_browse
after_create :initialize_main_navigation
include Spotlight::DefaultThumbnailable
-
- scope :published, -> { where(published: true) }
def main_about_page
@main_about_page ||= about_pages.published.first
end