Class: Refinery::Slideshow::Slideshow

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/refinery/slideshow/slideshow.rb

Instance Method Summary collapse

Instance Method Details

#titleObject

Needed for the dashboard’s activity list



19
20
21
# File 'app/models/refinery/slideshow/slideshow.rb', line 19

def title
  uid
end

#uid_not_blank_if_not_attachedObject



9
10
11
12
# File 'app/models/refinery/slideshow/slideshow.rb', line 9

def uid_not_blank_if_not_attached
  errors.add(:uid, :blank) if self.uid.blank? && self.attached.nil?
  errors.add(:uid, :taken) if self.attached.nil? && !self.class.where(uid: uid).detect{|s| s != self }.nil?
end