[#4177] Default Contract#executed to false.

This commit is contained in:
Eric Davis
2010-06-17 12:36:19 -07:00
parent 56e39ba3ca
commit 512db4bcf4
2 changed files with 10 additions and 1 deletions
+4
View File
@@ -29,6 +29,10 @@ class Contract < ActiveRecord::Base
attr_accessible :po_number
attr_accessible :details
def after_initialize
self.executed = false unless self.executed.present?
end
def start_and_end_date_are_valid
if start_date && end_date && end_date < start_date
errors.add :end_date, :greater_than_start_date
+6 -1
View File
@@ -26,6 +26,11 @@ class ContractTest < ActiveSupport::TestCase
end
should "QUESTION: name be unique"
should "default executed to false"
should "default executed to false" do
@contract = Contract.new
assert_equal false, @contract.executed
end
end