Module: RocketCMS::Models::News
- Extended by:
- ActiveSupport::Concern
- Includes:
- Enableable, ManualSlug, ElasticSearch, RocketCMS::Model, Seoable, SitemapData
- Included in:
- News
- Defined in:
- lib/rocket_cms/models/news.rb
Constant Summary
Constants included from SitemapData
SitemapData::SITEMAP_CHANGEFREQ_ARRAY
Constants included from Seoable
Seoable::FIELDS, Seoable::LOCALIZED_FIELDS
Instance Method Summary collapse
Methods included from SitemapData
Methods included from ManualSlug::ActiveRecord
Methods included from ManualSlug::Mongoid
Methods included from Seoable
admin, #og_image_jcrop_options
Methods included from SeoHelpers
Instance Method Details
#format_date ⇒ Object
52 53 54 |
# File 'lib/rocket_cms/models/news.rb', line 52 def format_date time.strftime(I18n.t('rs.format_time')) end |
#html5_date ⇒ Object
49 50 51 |
# File 'lib/rocket_cms/models/news.rb', line 49 def html5_date time.strftime('%Y-%m-%d') end |
#report_slug ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'lib/rocket_cms/models/news.rb', line 40 def report_slug if time.blank? name elsif name.blank? time.strftime('%Y-%m-%d') else time.strftime('%Y-%m-%d') + '-' + name[0..20] end end |