2

I am starting work on a large project in Rails 3. I want to build the app using both MySql and MongoDB. I already know how to use Rails with MySql, and have found a lot of info about using MongoDB and rails. But what I have not been able to find is any good information on using both MySql and MongoDB together. I was looking at the Mongoid project, and thought it would be good to use, thought I don't know if it is the best solution.

On the Mongoid site under the Installation/Configuration section it talks about using both Mongoid and ActiveRecord together, but it does not explain how.

So, I was hoping someone could tell me either how to set Mongoid and ActiveRecord to work together, or a better solution all together.

4
  • 1
    Did you google? Cause I just did and a bunch of sites came up w/ examples. Commented Jul 27, 2011 at 14:17
  • Yes I googled, I found lots of stuff too, but none of it explained how to get ActiveRecord and Mongoid to work together. If you would like to share what exactly you searched for, that would be great. Commented Jul 27, 2011 at 14:38
  • stackoverflow.com/questions/5411283/… stackoverflow.com/questions/6540500/… Commented Jul 27, 2011 at 14:45
  • I have already seen them, and id not find either very helpful. Commented Jul 27, 2011 at 15:13

1 Answer 1

5

With all the previous suggestions also just add few more lines in your application

In application.rb add

config.generators do |g|
  g.orm :active_record
end

This should do the trick and run mongoid and mysql parallely

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.