-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
When a document has a hash field, accessing it via [] and updating a property does not cause changed? to return true. I've been able to reproduce this error, but unable to discover a solution so far.
To reproduce, place these tests in changeable_spec.rb
The first one should pass, and the second should fail reproducing the error described above.
context "when a subfield is changed" do let(:person) do Person.create(map: { name: "value" }) end it "returns true" do person.map[:name] = "Another Person" expect(person).to be_changed end it "returns true if accessed via []" do person[:map][:name] = "The Third Person" expect(person).to be_changed end end