Created
December 14, 2013 18:44
-
-
Save filkinsteez/7963185 to your computer and use it in GitHub Desktop.
message class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Message | |
include ActiveModel::Validations | |
include ActiveModel::Conversion | |
extend ActiveModel::Naming | |
attr_accessor :name, :email, :subject, :body | |
validates :name, :email, :subject, :body, :presence => true | |
validates :email, :format => { :with => %r{.+@.+\..+} }, :allow_blank => true | |
def initialize(attributes = {}) | |
attributes.each do |name, value| | |
send("#{name}=", value) | |
end | |
end | |
def persisted? | |
false | |
end | |
def currentpatient | |
true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment