Module: RocketCMS::Models::News

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

Instance Method Summary collapse

Methods included from Seoable

admin, #get_og_title, #page_title, seo_config

Instance Method Details

#format_dateObject



37
38
39
# File 'lib/rocket_cms/models/news.rb', line 37

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

#html5_dateObject



34
35
36
# File 'lib/rocket_cms/models/news.rb', line 34

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

#report_slugObject



27
28
29
30
31
32
33
# File 'lib/rocket_cms/models/news.rb', line 27

def report_slug
  if name.blank?
    time.strftime('%Y-%m-%d')
  else
    time.strftime('%Y-%m-%d') + '-' + name[0..20]
  end
end