# File app/models/thema.rb, line 75 def fix_links(host) full_url= URI.parse(root_url(:host=>host)) self.text.gsub!(/src="[\.\/]*uploads\/attachment\/datei\/(\d+)\/thumb_big[^"]*"/){|s| full_url.path=Attachment.find($1.to_i).datei.thumb_big.url; 'src="'+full_url.to_s+'"'} self.text.gsub!(/src="[\.\/^"]*uploads\/attachment\/datei\/(\d+)\/[^"]*"/){|s| full_url.path=Attachment.find($1.to_i).datei.url; 'src="'+full_url.to_s+'"'} self.text.gsub!(/href="[^"]*themen\/(\d+)[^"]*"/){|s| full_url.path=thema_path(Thema.find($1.to_i)); 'href="'+full_url.to_s+'"'} end
# 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
# 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
Generated with the Darkfish Rdoc Generator 2.