-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow modifier field to be optional #205
Conversation
fix for #186 |
Looks good, needs specs, changelog, docs. |
4bebf51
to
50f4bfb
Compare
Changes Unknown when pulling 50f4bfb on yads:master into ** on mongoid:master**. |
@dblock it looks like the
Do you have any thoughts on how to handle this situation so that this feature works on mongoid versions < 6 and >= 6? |
You can use checks in Mongoid::Compatibility to see what version is being used in both the implementation and the specs, so no |
Changes Unknown when pulling 13063fa on yads:master into ** on mongoid:master**. |
@dblock added some specs and using mongoid-compatibility for feature detection. The only thing I had to up the rubocop module size as tracker.rb was right on the cusp of exceeding 176. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting close! Hang in there. There're no tests for the new modifier_field_optional
option, please add.
@@ -18,6 +18,7 @@ when /3/ | |||
else | |||
gem 'mongoid', version | |||
end | |||
gem 'mongoid-compatibility' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to become a .gemspec dependency, otherwise it will be failing at runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it's already in the .gemspec file. Is this not it? https://github.com/mongoid/mongoid-history/blob/master/mongoid-history.gemspec#L23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or are you saying to add a version dependency so that it works with version 0.5.1 or above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you don't need to add it here, don't you?
1 similar comment
3 similar comments
Yay, finally passing! |
@@ -55,7 +55,7 @@ Metrics/MethodLength: | |||
# Offense count: 2 | |||
# Configuration parameters: CountComments. | |||
Metrics/ModuleLength: | |||
Max: 176 | |||
Max: 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fyi usually we just run rubocop -a ; rubocop --auto-gen-config
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, I was wondering why 176 was the old value :)
Merging this, thanks! |
Coming from #221. Is the modifier still not actually enforced in Mongoid 6? A spec like https://github.com/mongoid/mongoid-history/blob/master/spec/unit/attributes/destroy_spec.rb never uses a modifier but succeeds in 6 and now fails in 7 saying a modifier is required. |
No description provided.