gitlabhq/doc/code/classes/Wiki.html
2012-12-30 14:43:00 +02:00

294 lines
No EOL
9 KiB
HTML

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Wiki</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/github.css" type="text/css" media="screen" />
<script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="banner">
<h1>
<span class="type">Class</span>
Wiki
<span class="parent">&lt;
ActiveRecord::Base
</span>
</h1>
<ul class="files">
<li><a href="../files/app/models/wiki_rb.html">app/models/wiki.rb</a></li>
</ul>
</div>
<div id="bodyContent">
<div id="content">
<div class="description">
<h2 id="label-Schema+Information">Schema Information</h2>
<p>Table name: wikis</p>
<pre>id :integer not null, primary key
title :string(255)
content :text
project_id :integer
created_at :datetime not null
updated_at :datetime not null
slug :string(255)
user_id :integer</pre>
</div>
<!-- Method ref -->
<div class="sectiontitle">Methods</div>
<dl class="methods">
<dt>R</dt>
<dd>
<ul>
<li>
<a href="#method-c-regenerate_from">regenerate_from</a>
</li>
</ul>
</dd>
<dt>S</dt>
<dd>
<ul>
<li>
<a href="#method-c-search">search</a>,
</li>
<li>
<a href="#method-i-set_slug">set_slug</a>
</li>
</ul>
</dd>
<dt>T</dt>
<dd>
<ul>
<li>
<a href="#method-i-to_param">to_param</a>
</li>
</ul>
</dd>
</dl>
<!-- Methods -->
<div class="sectiontitle">Class Public methods</div>
<div class="method">
<div class="title method-title" id="method-c-search">
<b>search</b>(query)
<a href="../classes/Wiki.html#method-c-search" name="method-c-search" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-c-search_source')" id="l_method-c-search_source">show</a>
</p>
<div id="method-c-search_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/models/wiki.rb, line 33</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">search</span>(<span class="ruby-identifier">query</span>)
<span class="ruby-identifier">where</span>(<span class="ruby-string">&quot;title like :query OR content like :query&quot;</span>, <span class="ruby-identifier">query</span><span class="ruby-operator">:</span> <span class="ruby-node">&quot;%#{query}%&quot;</span>)
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="sectiontitle">Class Protected methods</div>
<div class="method">
<div class="title method-title" id="method-c-regenerate_from">
<b>regenerate_from</b>(wiki)
<a href="../classes/Wiki.html#method-c-regenerate_from" name="method-c-regenerate_from" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-c-regenerate_from_source')" id="l_method-c-regenerate_from_source">show</a>
</p>
<div id="method-c-regenerate_from_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/models/wiki.rb, line 40</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">self</span>.<span class="ruby-identifier">regenerate_from</span> <span class="ruby-identifier">wiki</span>
<span class="ruby-identifier">regenerated_field</span> = [<span class="ruby-value">:slug</span>, <span class="ruby-value">:content</span>, <span class="ruby-value">:title</span>]
<span class="ruby-identifier">new_wiki</span> = <span class="ruby-constant">Wiki</span>.<span class="ruby-identifier">new</span>
<span class="ruby-identifier">regenerated_field</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">field</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">new_wiki</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{field}=&quot;</span>, <span class="ruby-identifier">wiki</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">field</span>))
<span class="ruby-keyword">end</span>
<span class="ruby-identifier">new_wiki</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="sectiontitle">Instance Public methods</div>
<div class="method">
<div class="title method-title" id="method-i-to_param">
<b>to_param</b>()
<a href="../classes/Wiki.html#method-i-to_param" name="method-i-to_param" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-to_param_source')" id="l_method-i-to_param_source">show</a>
</p>
<div id="method-i-to_param_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/models/wiki.rb, line 28</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">to_param</span>
<span class="ruby-identifier">slug</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="sectiontitle">Instance Protected methods</div>
<div class="method">
<div class="title method-title" id="method-i-set_slug">
<b>set_slug</b>()
<a href="../classes/Wiki.html#method-i-set_slug" name="method-i-set_slug" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-set_slug_source')" id="l_method-i-set_slug_source">show</a>
</p>
<div id="method-i-set_slug_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/models/wiki.rb, line 50</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">set_slug</span>
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">slug</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">title</span>.<span class="ruby-identifier">parameterize</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
</div>
</div>
</body>
</html>