624 lines
15 KiB
HTML
624 lines
15 KiB
HTML
|
<html>
|
||
|
<head>
|
||
|
<style>
|
||
|
table { background: #fff; color: #000; }
|
||
|
.ruby .normal { color: #000; }
|
||
|
.ruby .comment { color: #005; font-style: italic; }
|
||
|
.ruby .keyword { color: #A44; font-weight: bold; }
|
||
|
.ruby .method { color: #44f; }
|
||
|
.ruby .class { color: #b1713d; }
|
||
|
.ruby .module { color: #050; }
|
||
|
.ruby .punct { color: #668; font-weight: bold; }
|
||
|
.ruby .symbol { color: #00f; }
|
||
|
.ruby .string { color: #4a4; }
|
||
|
.ruby .char { color: #F07; }
|
||
|
.ruby .ident { color: #000; }
|
||
|
.ruby .constant { color: #b1713d; }
|
||
|
.ruby .regex { color: #B66; background: #FEF; }
|
||
|
.ruby .number { color: #F99; }
|
||
|
.ruby .attribute { color: #f84; }
|
||
|
.ruby .global { color: #7FB; }
|
||
|
.ruby .expr { color: #227; }
|
||
|
.ruby .escape { color: #277; }
|
||
|
</style>
|
||
|
<title>Analyzed File Report</title>
|
||
|
</head>
|
||
|
<body>
|
||
|
<table cellpadding='0' cellspacing='0' class='ruby'>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n1" name="n1">1</a></span><span class="keyword">class</span> <span class="class">Share</span> < <span class="constant">ActiveRecord</span>::<span class="constant">Base</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n2" name="n2">2</a></span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n3" name="n3">3</a></span> validates <span class="symbol">:content</span>, <span class="key">presence</span>: <span class="predefined-constant">true</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n4" name="n4">4</a></span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n5" name="n5">5</a></span> validates <span class="symbol">:project_id</span>, <span class="key">presence</span>: <span class="predefined-constant">true</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n6" name="n6">6</a></span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n7" name="n7">7</a></span> validates <span class="symbol">:user_id</span>, <span class="key">presence</span>: <span class="predefined-constant">true</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n8" name="n8">8</a></span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"> <a href="#n9" name="n9">9</a></span> validate <span class="symbol">:share_has_atleast_one_character</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><strong><a href="#n10" name="n10">10</a></strong></span> validate <span class="symbol">:user_exists</span>,<span class="key">on</span>: <span class="symbol">:create</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n11" name="n11">11</a></span> validate <span class="symbol">:project_exists</span>,<span class="key">on</span>: <span class="symbol">:create</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n12" name="n12">12</a></span> private
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n13" name="n13">13</a></span> <span class="keyword">def</span> <span class="function">share_has_atleast_one_character</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n14" name="n14">14</a></span> tmp = content.strip
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n15" name="n15">15</a></span> <span class="keyword">if</span> tmp.length < <span class="integer">1</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n16" name="n16">16</a></span> errors[<span class="symbol">:content</span>] = <span class="string"><span class="delimiter">"</span><span class="content">share content should has at least one character</span><span class="delimiter">"</span></span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n17" name="n17">17</a></span> <span class="keyword">end</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n18" name="n18">18</a></span> <span class="keyword">end</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n19" name="n19">19</a></span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><strong><a href="#n20" name="n20">20</a></strong></span> <span class="keyword">def</span> <span class="function">user_exists</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n21" name="n21">21</a></span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n22" name="n22">22</a></span> user = <span class="constant">User</span>.find_by(<span class="key">id</span>: user_id)
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n23" name="n23">23</a></span> <span class="keyword">if</span> user == <span class="predefined-constant">nil</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n24" name="n24">24</a></span> errors[<span class="symbol">:user</span>] = <span class="string"><span class="delimiter">"</span><span class="content">user belong to Share is not exist</span><span class="delimiter">"</span></span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n25" name="n25">25</a></span> <span class="keyword">end</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n26" name="n26">26</a></span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n27" name="n27">27</a></span> <span class="keyword">end</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n28" name="n28">28</a></span> <span class="keyword">def</span> <span class="function">project_exists</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n29" name="n29">29</a></span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><strong><a href="#n30" name="n30">30</a></strong></span> project = <span class="constant">Project</span>.find_by(<span class="key">id</span>: project_id)
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n31" name="n31">31</a></span> <span class="keyword">if</span> project == <span class="predefined-constant">nil</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n32" name="n32">32</a></span> errors[<span class="symbol">:project</span>] = <span class="string"><span class="delimiter">"</span><span class="content">user belong to Share is not exist</span><span class="delimiter">"</span></span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n33" name="n33">33</a></span> <span class="keyword">end</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n34" name="n34">34</a></span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n35" name="n35">35</a></span> <span class="keyword">end</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n36" name="n36">36</a></span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
|
||
|
<tr>
|
||
|
<td valign='top'>
|
||
|
|
||
|
|
||
|
|
||
|
</td>
|
||
|
<td valign='top'>
|
||
|
<div class="CodeRay">
|
||
|
<div class="code"><pre><span class="line-numbers"><a href="#n37" name="n37">37</a></span><span class="keyword">end</span>
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
</tr>
|
||
|
|
||
|
</table>
|
||
|
</body>
|
||
|
</html>
|