couchrest/couchrest_model — Issue #125: changes to model properties are not saved
Author: raldred
Created: 2011-11-02 13:22:27+00:00
State: open

I've upgraded from 1.0 to 1.1.2
There now seems to an issue with my models where changes to properties are not recognised so model.save returns true but never makes a put request to couch.

eg...

class ExamSitting < CouchRest::Model::Base
property :seen_questions, Array, :default => []
end

@exam_sitting = ExamSitting.get params[:id]
@exam_sitting.seen_questions << @questions.id
@exam_sitting.save

also....

@exam_sitting.chosen_answers[@question.id]['answer'] = 'xxxxx'
@exam_sitting.save

These all used to work previously absolutely fine.

it's like the object you get back from get or a view is not the actual state of the document.
So when making changes, sometimes the underlying data structure is not updated.
So when calling save it things theres no changes.

Rob