Make AR setter methods private?

There's also the fact that the instance's setter/getter methods are only defined later, and so you can't do
class Customer
   private :first_name
end
Since there is no first_name method at that point. The same applies obviously to making the methods protected. You could probably achieve something in after_initialize though.

Fred

Right, but you can certainly define the methods yourself:

class Customer < ActiveRecord::Base
  def first_name
    read_attribute :first_name
  end
  private :first_name
end

Pat