Skip to content

Mongoid compatibility - #80

Open
GUI wants to merge 4 commits into
mbleigh:masterfrom
GUI:mongoid
Open

Mongoid compatibility#80
GUI wants to merge 4 commits into
mbleigh:masterfrom
GUI:mongoid

Conversation

@GUI

@GUI GUI commented Sep 3, 2014

Copy link
Copy Markdown

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.

GUI added 4 commits September 2, 2014 07:05
This is to solve issues in Mongoid apps where ActiveRecord is disabled.
Some other gems were simply checking for the existence of
ActiveRecord::Base and then were trying to operate on the ActiveRecord
connection. This change should prevent the seed-fu library from
requiring ActiveRecord in a non-ActiveRecord Rails app.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant