title: DEPRECATION WARNING on save with ruby and active_record
body: <p>I am new to ruby and writing a small script that requires writing messages to a database log.</p>
  
  <p>I am using ruby 1.9.3 with active_record but without rails. All select statements work fine, but my write to log function is returning the following error:</p>
  
  <pre><code>DEPRECATION WARNING: You're trying to create an attribute `ID'. Writing arbitrary attributes on a model is deprecated. Please just use `attr_writer` etc.
  </code></pre>
  
  <p>my model looks like that</p>
  
  <pre><code>class ActLog &lt; ActiveRecord::Base
    self.table_name = "ActLog"
    self.primary_key = "ID"
  end
  </code></pre>
  
  <p>and my log function:</p>
  
  <pre><code>def log(level, message)
    level.upcase!
    line = ActLog.new
    line.level = level
    line.message = message
    line.module = 'script'
    line.date = Time.new.strftime("%Y-%m-%d %H:%M:%S")
    line.save
  end
  </code></pre>
  
  <p>the <code>ID</code> field is an int auto_increment.</p>
  
  <p>The log function will be called many times during the execution. Is that the best way to write to the log and why is the deprecation warning popping up?</p>