Class: Georgia::Widget
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Georgia::Widget
- Includes:
- Concerns::Contentable
- Defined in:
- app/models/georgia/widget.rb
Instance Method Summary collapse
Instance Method Details
#content_presence ⇒ Object
17 18 19 20 21 |
# File 'app/models/georgia/widget.rb', line 17 def content_presence contents.each do |content| errors.add(:base, I18n.t("locales.#{content.locale}") + ' Title is required.') unless content.title.present? end end |
#featured? ⇒ Boolean
23 24 25 |
# File 'app/models/georgia/widget.rb', line 23 def featured? @featured ||= pages.any? end |
#featured_count ⇒ Object
27 28 29 |
# File 'app/models/georgia/widget.rb', line 27 def featured_count @featured_count ||= pages.count end |