You should probably use the accessor method when getting the name attribute as the `[]` method won't call an accessor method. See this example:

```
class Product < ActiveRecord::Base

  def name
    self.read_attribute(:name).capitalize
  end
end

p = Product.find(1)
p.name # Bob
p[:name] # bob
```