Module: RocketCMS::Models::News

Extended by:
ActiveSupport::Concern
Includes:
Enableable, ManualSlug, RocketCMS::Model, Search, Seoable
Included in:
News
Defined in:
lib/rocket_cms/models/news.rb

Constant Summary

Constants included from Seoable

Seoable::FIELDS, Seoable::LOCALIZED_FIELDS

Instance Method Summary collapse

Methods included from SeoHelpers

#get_og_title, #page_title

Instance Method Details

#format_dateObject


50
51
52
# File 'lib/rocket_cms/models/news.rb', line 50

def format_date
  time.strftime('%d.%m.%Y')
end

#html5_dateObject


47
48
49
# File 'lib/rocket_cms/models/news.rb', line 47

def html5_date
  time.strftime('%Y-%m-%d')
end

#report_slugObject


38
39
40
41
42
43
44
45
46
# File 'lib/rocket_cms/models/news.rb', line 38

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