Class: Effective::CarouselItem

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/effective/carousel_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_userObject

Returns the value of attribute current_user.



8
9
10
# File 'app/models/effective/carousel_item.rb', line 8

def current_user
  @current_user
end

Instance Method Details

#bodyObject

As per has_many_rich_texts



63
64
65
# File 'app/models/effective/carousel_item.rb', line 63

def body
  rich_text_body
end

#numberObject



67
68
69
# File 'app/models/effective/carousel_item.rb', line 67

def number
  '#' + position.to_s
end

#to_sObject



58
59
60
# File 'app/models/effective/carousel_item.rb', line 58

def to_s
  persisted? ? [carousel, number].join(' ') : 'carousel item'
end