1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

Fix contact model and spec.

This commit is contained in:
Dan Barber 2013-06-05 10:33:48 +01:00
parent 9c1fb4b57c
commit 0f2f58c42d
2 changed files with 2 additions and 2 deletions

View File

@ -11,11 +11,10 @@ class Contact
attributes.each do |key, value|
self.send("#{key}=", value)
end
@attributes = attributes
end
def read_attribute_for_validation(key)
@attributes[key]
self.send(key)
end
def save

View File

@ -6,4 +6,5 @@ describe Contact do
it { should validate_presence_of(:message) }
it { should allow_value("test@test.com").for(:email) }
it { should_not allow_value("test@test").for(:email) }
end