Parent

Included Modules

Class/Module Index [+]

Quicksearch

Thema

Public Instance Methods

is_outdated?() click to toggle source
# File app/models/thema.rb, line 57
def is_outdated?
  unless translation.try(:updated_at).nil?
    translation.updated_at < 7.month.ago
  else
    false
  end
end
text_first_words() click to toggle source
# File app/models/thema.rb, line 65
def text_first_words
  md = /<p>(?<text>[^\<\>]*)/.match Sanitize.clean(self.text,:elements=>['p'])
  words=md[:text].split(" ") unless md.nil?
  if words.nil? || words.empty?
    "...."
  else
    words[0..100].join(" ")+ " ..." unless  words.nil?
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.