Module: RocketCMS::Models::News

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

Instance Method Summary collapse

Methods included from ManualSlug::ActiveRecord

#text_slug, #text_slug=

Methods included from ManualSlug::Mongoid

#text_slug, #text_slug=

Methods included from Seoable

admin, #get_og_title, #page_title, seo_config

Instance Method Details

#format_dateObject



42
43
44
# File 'lib/rocket_cms/models/news.rb', line 42

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

#html5_dateObject



39
40
41
# File 'lib/rocket_cms/models/news.rb', line 39

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

#report_slugObject



30
31
32
33
34
35
36
37
38
# File 'lib/rocket_cms/models/news.rb', line 30

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