Fixes for 4 of the original 10 failing specs
This commit is contained in:
parent
15ea10eb9c
commit
151ea5566d
2 changed files with 7 additions and 2 deletions
|
@ -58,6 +58,10 @@ module CouchRest
|
||||||
key = self.has_key?(property.name) ? property.name : property.name.to_sym
|
key = self.has_key?(property.name) ? property.name : property.name.to_sym
|
||||||
# Don't cast the property unless it has a value
|
# Don't cast the property unless it has a value
|
||||||
next if (value = self[key]).nil?
|
next if (value = self[key]).nil?
|
||||||
|
# Don't cast the property if it is not accessible
|
||||||
|
if self.class.respond_to? :accessible_properties
|
||||||
|
next if self.class.accessible_properties.index(key).nil?
|
||||||
|
end
|
||||||
write_property(property, value)
|
write_property(property, value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -175,8 +175,9 @@ describe "ExtendedDocument properties" do
|
||||||
@course['participants'].should eql([{}, 'q', 1])
|
@course['participants'].should eql([{}, 'q', 1])
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should cast end_date to Date" do
|
it "should cast started_on to Date" do
|
||||||
@event['end_date'].should be_an_instance_of(Date)
|
@course.started_on = Date.today
|
||||||
|
@course['started_on'].should be_an_instance_of(Date)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue