I have the following class:
class Message
extend ActiveModel::Naming
include ActiveModel::Conversion
attr_accessor :name, :emails, :custom_content
def initialize(attrs = {})
attrs.each do |k, v|
self.send "#{k}=", v
end
end
def persisted?
false
end
def email_list
self.emails.split(",").collect { |email| {:email => email.delete(" ")} }
end
end
I always want to capitalize the name attribute instead of having to always do it when I call the attribute in code.