Sha256: 51e0dae36cff14b7d71db13320574a3cbfd945c776682c63da71c8250153e108

Contents?: true

Size: 522 Bytes

Versions: 1

Compression:

Stored size: 522 Bytes

Contents

class Spotlight::Masthead < Spotlight::FeaturedImage
  mount_uploader :image, Spotlight::MastheadUploader

  def display?
    self.display && image.cropped.present?
  end
  
  # 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..
  def remote_image_url= url
    unless url.starts_with? "/"
      super url
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blacklight-spotlight-0.4.1 app/models/spotlight/masthead.rb