mongoid / mongoid-slug

Generates a URL slug/permalink based on fields in a Mongoid-based model.
https://github.com/mongoid/mongoid-slug
MIT License
492 stars 164 forks source link

Add support for Mongoid 7 #252

Closed kailan closed 6 years ago

kailan commented 6 years ago

This pull request adds support for Mongoid 7 (whilst maintaining backwards compatibility) at the expense of removing mongoid_paranoia due to its lack of support for the latest Mongoid version. Although this may be considered a blocker for releasing a new version, a quick look at the network tab for this repository shows many users forking the repository and performing hacky updates (breaking paranoia support along with other features) to allow their dependent applications to update to Mongoid 7, as paranoia is a feature used by very few users. For users that wish to continue using paranoia with older versions, they are still available. Existing applications using proper versioning in Gemfiles will not be affected.

This pull request also introduces the use of Mongoid::Compatibility mongoid5_or_newer? and mongoid6_or_newer? methods rather than strict version checks, allowing future non-breaking Mongoid releases to be supported without the need for updates.

Tests pass locally on all Mongoid versions from 3-7, although Travis is reporting failures for Mongoid 3 and 4 due to issues with the test environment. Running a Travis build on the current HEAD also fails for the same reasons, so this pull request is not the cause for these failures.

dblock commented 6 years ago

This looks good to me. Down with paranoia. We do need to fix the build, whether the failures are new in the test environment or not, before we get this merged.

kailan commented 6 years ago

Yeah no worries, I'm happy to look into that in the morning. Aiming for all greens!

kailan commented 6 years ago

@dblock Tests passing on all versions 🎉

dblock commented 6 years ago

I'll take a closer look shortly. What was the issue?

dblock commented 6 years ago

Oh the ...purge thing again, got it...

dblock commented 6 years ago

I just merged this, great work.

Want to help co-maintain the gem @kailan? You could do the next release. Give me your rubygems email if so.

kailan commented 6 years ago

I would love to @dblock 👍

kailan@kmp.pw

dblock commented 6 years ago

Great, accept the invite at https://github.com/mongoid/mongoid-slug/invitations. Added you to Rubygems.

Opened https://github.com/mongoid/mongoid-slug/issues/253 for next release, thanks!