This could be simplified possibly!

```ruby
def location=(location)
   self.address_city, self.address_state = location.split(', ').compact.map(&:lstrip) if location.present?
end

def address_city=(city)
   assign_attribute(:address_city, city.titleize) if city.present?
end

def address_state=(state)
   assign_attribute(:address_state, state.upcase) if state.present?
end
```