3 questions

1)
validates_format_of :name, :with => /\A(\w(?:[\/' \-\.])?)*\Z/i

What does the 'i' do at the end of the regular expression?

2)
Should I do validation for attributes that are not from a form?

3)
  def self.up
    create_table :customers do |t|
      t.column :number, :integer, :limit => 4
    end
  end

As far as I know, Mysql 5.0.27 uses Int for number here. Will also a
small number need 4 bytes in the database?

validates_format_of :name, :with => /\A(\w(?:[\/' \-\.])?)*\Z/i

What does the 'i' do at the end of the regular expression?

/i makes a regex case-insensitive. See
http://www.ruby-doc.org/core/classes/Regexp.html#M001219
for other Regexp options