app/models/spotlight/feature_page.rb in blacklight-spotlight-0.32.0 vs app/models/spotlight/feature_page.rb in blacklight-spotlight-0.33.0
- old
+ new
@@ -7,20 +7,18 @@
has_many :child_pages, class_name: 'Spotlight::FeaturePage', inverse_of: :parent_page, foreign_key: 'parent_page_id'
belongs_to :parent_page, class_name: 'Spotlight::FeaturePage'
accepts_nested_attributes_for :child_pages
- accepts_nested_attributes_for :thumbnail, update_only: true
+ belongs_to :thumbnail, class_name: 'Spotlight::FeaturedImage', dependent: :destroy
+ accepts_nested_attributes_for :thumbnail, update_only: true, reject_if: proc { |attr| attr['iiif_tilesource'].blank? }
+
before_validation unless: :top_level_page? do
self.exhibit = top_level_page_or_self.exhibit
end
def display_sidebar?
child_pages.published.present? || display_sidebar
- end
-
- def thumbnail_image_url
- thumbnail.image.thumb.url if thumbnail && thumbnail.image
end
end
end