Hello everyone i am trying to save a nested model but it will always
fail because 2 fields are missing
I tried to examine what happens so i print the object to yaml, here s
what i got:
-
&id001 !ruby/object:Contract
attributes:
price:
room_id:
start_date: 15/09/2009
created_at:
is_consecutive: false
same_sex: false
comments:
updated_at:
has_keys: false
touched_by:
amount_to_keep: 0
house_id:
user_id: 0
paid_percent: 0.0
has_signed: false
shared: true
house_rating: 0
deposit_returned: false
service_rating: 0
booking_date:
end_date: 14/02/2010
active: false
attributes_cache:
start_date:
end_date:
changed_attributes: {}errors: !ruby/object:ActiveRecord::Errors
base: *id001
errors:
base:
- !ruby/object:ActiveRecord::Error
attribute: :base
base: *id001
message: Please tell us when your rental period should start
options: {}type: Please tell us when your rental period should start - !ruby/object:ActiveRecord::Error attribute: :base base: *id001 message: Please tell us when your rental period should end options: {} type: Please tell us when your rental period should end
new_record: true
The only fields that i am checking for presence are the start_date and
end_date as you can see in the yaml they have a value but then
validation fails.
Thanx a lot for your time