Class: BcmsContentRotator::Slide
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- BcmsContentRotator::Slide
- Defined in:
- app/models/bcms_content_rotator/slide.rb
Instance Method Summary collapse
- #has_link? ⇒ Boolean
- #image_url ⇒ Object
-
#nav_title_or_name ⇒ Object
The title of the link users click on the change slides.
- #set_attachment_file_path ⇒ Object
- #set_attachment_section ⇒ Object
Instance Method Details
#has_link? ⇒ Boolean
28 29 30 |
# File 'app/models/bcms_content_rotator/slide.rb', line 28 def has_link? !link_url.blank? end |
#image_url ⇒ Object
19 20 21 |
# File 'app/models/bcms_content_rotator/slide.rb', line 19 def image_url file.url end |
#nav_title_or_name ⇒ Object
The title of the link users click on the change slides.
24 25 26 |
# File 'app/models/bcms_content_rotator/slide.rb', line 24 def nav_title_or_name .blank? ? name : end |
#set_attachment_file_path ⇒ Object
7 8 9 10 11 |
# File 'app/models/bcms_content_rotator/slide.rb', line 7 def if !.blank? .file_path = "/slides/attachment/#{Time.now.to_s(:year_month_day)}/#{name.to_slug}.#{.original_filename.split('.').last.to_s.downcase}" end end |
#set_attachment_section ⇒ Object
13 14 15 16 17 |
# File 'app/models/bcms_content_rotator/slide.rb', line 13 def if !.blank? .section = Section.first(:conditions => {:name => 'Slide'}) end end |