mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
16 lines
305 B
Ruby
16 lines
305 B
Ruby
class Contact
|
|
include ActiveModel::Validations
|
|
|
|
validates_presence_of :email, :name, :message
|
|
|
|
validates :email, email: true
|
|
|
|
attr_accessor :id, :email, :subject, :name, :message
|
|
|
|
def initialize(attributes = {})
|
|
attributes.each do |key, value|
|
|
send("#{key}=", value)
|
|
end
|
|
end
|
|
end
|