Class: Spotlight::Masthead

Inherits:
FeaturedImage show all
Defined in:
app/models/spotlight/masthead.rb

Overview

Exhibit and browse category mastheads

Instance Method Summary collapse

Methods inherited from FeaturedImage

#document

Instance Method Details

#display?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'app/models/spotlight/masthead.rb', line 7

def display?
  display && image.cropped.present?
end

#remote_image_url=(url) ⇒ Object

Duplicated from Spotlight::FeaturedImage, because mount_uploader will overwrite it..

if the image is local, this step will fail.. hopefully it’s local because it’s an uploaded resource, and we’ll catch is in before_validation..



17
18
19
# File 'app/models/spotlight/masthead.rb', line 17

def remote_image_url=(url)
  super url unless url.starts_with? '/'
end