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.
I'm not entirely sure if you're interested in this, or if this even belongs in seed-fu, but I thought I'd submit this pull request to get feedback.
This adds support for seeding Mongoid models with seed-fu. Mongoid models act a lot like ActiveRecord models, so there wasn't a terrible amount that had to change. A few things had to be wrapped in conditionals based on the model class type, but otherwise the core logic worked fine under Mongoid. All tests pass against Mongoid and continue to pass against ActiveRecord.
Is this something you'd be interested in integrating into seed-fu proper, or do you think this functionality would be better suited for a separate mongoid-only gem?
For reference, there is an existing seed-fu-mongoid project that looks to accomplish the same thing for mongoid only. However, I ran into a couple bugs with that project (seed constraints for anything other than
id
seem broken), so I decided to take a quick gander at integrating this functionality directly into seed-fu.