Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Rails4 compatability #493

IlyaDonskikh opened this Issue · 17 comments

9 participants


When the release version for Rails4?

  mongo_mapper (>= 0) ruby depends on
      activemodel (~> 3.0) ruby

    rails (~> 4.0.0.beta) ruby depends on
      activemodel (4.0.0.beta)
@jcaudle jcaudle closed this
@jcaudle jcaudle reopened this

Thanks for the suggestion @IlyaDonskikh. This is definitely something to work toward, however, my biggest concern with it is how different some of the querying methods are in ActiveRecord 4. I've just recently come on board to help out with maintenance on the project, and want to get a new release of the 0.x version of the gem out soon, but I need to get the tests passing on ruby 1.8.7 through ruby 2.0 to do that.

I think the differences between Rails 3 and 4 might justify a major version number difference between the gem supporting the two major versions of Rails, but I'm concerned about all the connotations a 1.x version of the gem brings with it, and I'm not certain that it makes sense for supporting Rails 4.

I'd like to hear from some of the members of the MongoMapper community on what their thoughts are on this.


I'd be ok with a 1.0 release. I am terrible at actually releasing 1.0 projects. I don't know that I have a single one. haha.


If there's something I can do to help with this, let me know. I have a few gems that I've adapted testing to multiple versions of Rails, if the project is interested in this, I can submit a pull request.


@steveklabnik, thanks for the offer. There is currently configuration for testing multiple versions of Rails 3. Is there something more to it you'd suggest than adding another gemfile? Feel free to make a pull request if you'd like.


Ah ha! Somehow, I missed that.


I don't have my app booting on Rails 4 yet, so I can't actually test on a Rails 4 app. I did test on a skeleton app and the world didn't blow up, but I'd love for someone who has a running Rails 4 app to actually drop that branch in and give it a run through the ol' test suite or two.

I'm waiting on review of that branch by the other team members before merging it, since it does include some substantial changes.

In terms of releases, I'd like to do the following:

  1. A 0.13.0 maintenance release of things like the already-merged performance improvements and bugfixes, but which doesn't break any backwards compatibility. This is a drop-in upgrade for people who are on 0.12.0.
  2. A 1.0.0 release which includes Rails 4 support and fixes things like association saves on assignment, which is a change that breaks backwards compatibility. Any other breaking changes would go into this release, too. I feel a lot more comfortable breaking things on a major release.

There's a 1.0 milestone with a number of still-open tickets. I'd like to close as many of those issues as possible for a proper 1.0 release. Since Rails 4 is already out, it may be appropriate to go ahead and do a 1.0.0.beta1 release or something that gets Rails 4 support in the bag while we fold in the rest of the 1.0.0 milestone fixes and features.

@steveklabnik If you have any pointers as to things I should be looking at for Rails 4 compat, I'm all ears. So far it was mostly test suite refactoring to get it actually passing the suite, then I did things like making scopes and attr_protected/attr_accessible follow Rails 4's AR conventions. If there's more I should be looking for, please drop it on me!


Okay, so one other thing we should look at --

AR's #all in Rails 4 returns a query proxy, rather than an array of records. This is trivial to do by just aliasing all to where, but it means that we would have to then coalesce the query into an array for usage. This is another potentially breaking change. Thoughts?


Yes, that change is probably the biggest one.


I have tested a few smaller apps I have running on Rails 3.2 + MM and moved them to @cheald's branch + Rails 4.0. Have yet to see any major issues, but since the apps have very few relations/models and most is manually tested, I cannot say 100% certain that there are no issues.

Although I think that #529 should be merged in a 1.0 / Rails 4.0 release and documented.

Or how about calling it 4.0 ? So it is easy to see that it is related with Rails 4?


@cheald is there any specific areas regarding the rails 4 that you would like assistance with?

I've been looking through issues etc but can't find any specific stuff regarding what's missing etc. If we could setup a milestone dedicated to it with specific issues etc maybe that would lower the barrier for others to contribute.


To be clear, the milestone is a great idea. I'll see what I can do there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.