Class: Spotlight::FeaturedImage
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spotlight::FeaturedImage
- Defined in:
- app/models/spotlight/featured_image.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#document ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'app/models/spotlight/featured_image.rb', line 28 def document return unless document_global_id && source == 'exhibit' if @document and document_global_id != @document.to_global_id.to_s @document = nil end @document ||= GlobalID::Locator.locate document_global_id end |
#remote_image_url=(url) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'app/models/spotlight/featured_image.rb', line 19 def remote_image_url= url # 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.. unless url.starts_with? "/" super url end end |