Fixing failures against Mongoid master. #125
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mongoid 2.3 (current master) has some internal changes around the way that default attributes are applied that broke the current state_machine implementation. This pull request addresses those issues.
Note there are 2 tests that I commented on in which I thought the expectation of the test (as the test was named) was incorrect. I changed these tests to pass, but the assertion does not match the expectation anymore. I do believe though the assertions are correct as I would not anticipate anything to show up in the dirty tracking when the state attribute has not actually changed itself:
https://github.com/durran/state_machine/blob/mongoid-2.3-fixes/test/unit/integrations/mongoid_test.rb#L660
https://github.com/durran/state_machine/blob/mongoid-2.3-fixes/test/unit/integrations/mongoid_test.rb#L665
I also tested against our current applications and all our tests there are passing.
Note: Mongoid 2.3.0 will be released this weekend.
My apologies for the trailing whitespace removal on the changed files - I have git hooks that just automatically do it.