title: How to iterate ActiveRecord Attributes, including attr_accessor methods
body: <p>I've looked everywhere for an elegant solution.  The essential problem seems to be that ActiveRecord attributes that map to database columns are handled completely differently in ActiveRecord::Base than attr_accessor methods.</p>
  
  <p>I would like to do something like:</p>
  
  <pre><code>model.attribute_names.each do |name|
    # do stuff
  end
  </code></pre>
  
  <p>in a way that also includes attr_accessor fields, but not any other instance methods. I know this in not built-in, but what is the most elegant way to do it?</p>