Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > d51872cc0e1fdee944d71993f94ac764 > files > 758

ruby-activerecord-2.3.4-1mdv2010.0.noarch.rpm

<?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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: ActiveRecord::Timestamp</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">ActiveRecord::Timestamp</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/lib/active_record/timestamp_rb.html">
                lib/active_record/timestamp.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
Active Record automatically timestamps create and update operations if the
table has fields named created_at/created_on or updated_at/updated_on.
</p>
<p>
Timestamping can be turned off by setting
</p>
<pre>
  &lt;tt&gt;ActiveRecord::Base.record_timestamps = false&lt;/tt&gt;
</pre>
<p>
Timestamps are in the local timezone by default but you can use UTC by
setting
</p>
<pre>
  &lt;tt&gt;ActiveRecord::Base.default_timezone = :utc&lt;/tt&gt;
</pre>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000058">touch</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000058" class="method-detail">
        <a name="M000058"></a>

        <div class="method-heading">
          <a href="Timestamp.src/M000058.html" target="Code" class="method-signature"
            onclick="popupCode('Timestamp.src/M000058.html');return false;">
          <span class="method-name">touch</span><span class="method-args">(attribute = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Saves the record with the updated_at/on attributes set to the current time.
If the save fails because of validation errors, an <a
href="RecordInvalid.html">ActiveRecord::RecordInvalid</a> exception is
raised. If an attribute name is passed, that attribute is used for the <a
href="Timestamp.html#M000058">touch</a> instead of the updated_at/on
attributes.
</p>
<p>
Examples:
</p>
<pre>
  product.touch               # updates updated_at
  product.touch(:designed_at) # updates the designed_at attribute
</pre>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>