emberjs/ember-rails — pull request #47 by indirect (2012-05-03 22:20:39+00:00)
Title: Robust environments

These changes revamp the way that ember-rails injects ember into the asset pipeline.

tl;dr: you get production ember when Rails.env.test?, the wrong version of ember is never added to the Sprockets asset path, and you can customize which version of ember you get (e.g. ember-spade in development).

Full explanation:
I updated to the latest versions of Ember and Ember-data as of a couple of days ago.

I also removed Ember from vendor/assets/javascripts completely. It is important to do that because Rails will automatically add that entire tree to the asset pipeline. That makes it possible to get the production version of Ember when you were expecting the development version of Ember and vice versa, depending on exactly how the asset paths are ordered and whether you sacrificed the correct farmyard animal to Sprockets within the last month.

In addition, this commit provides a map between Rails environments and the version of Ember that ember-rails will automatically provide. The default is to map the Rails test environment to the production version of Ember, and it is trivially changeable. If you are, for example, using capybara-webkit to do acceptance testing, you absolutely want to run your acceptance tests against the production version of Ember. The previous behaviour was to provide the development version of Ember test environments. Testing against the development version means that you could potentially deploy to production and only then have it blow up, which is pretty dangerous IMO.