Sha256: 9fd9d7ec25810411fb347df6c37c32f4b5f8e4696dd92427d289100e3938fe85
Contents?: true
Size: 1.65 KB
Versions: 8
Compression:
Stored size: 1.65 KB
Contents
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>active? (Period)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> <pre><span class="ruby-comment cmt"># File app/models/period.rb, line 44</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">active?</span>(<span class="ruby-identifier">check_tasks</span> = <span class="ruby-keyword kw">false</span>) <span class="ruby-identifier">start_on</span> <span class="ruby-operator"><=</span> <span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span> <span class="ruby-operator">&&</span> (<span class="ruby-identifier">end_on</span> <span class="ruby-operator">>=</span> <span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span> <span class="ruby-operator">||</span> (<span class="ruby-identifier">check_tasks</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">tasks</span>.<span class="ruby-identifier">select</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">task</span><span class="ruby-operator">|</span> <span class="ruby-identifier">task</span>.<span class="ruby-identifier">active?</span>}.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>)) <span class="ruby-keyword kw">end</span></pre> </body> </html>
Version data entries
8 entries across 4 versions & 1 rubygems