emberjs/ember-rails — pull request #299 by dmarkow (2013-11-02 03:39:25+00:00)
Title: Fix operator precedence for setting ember variant to Rails environment

The recent change to use the Rails environment to determine the ember variant has broken operator precedence. The line was being treated as follows:

variant = (app.config.ember.variant || ::Rails.env.production?) ? :production : :development

which means the only time a development build will be used is when there is __not a__ `config.ember.variant = :development` line in your configuration and you're running in Rails' development mode -- Setting the variant to any truthy value (which includes `:development`) would result in the `:production` variant being used.

This can be fixed by wrapping the Rails env check in parentheses instead (which is what I'm doing), though you could also use Ruby's `or` operator instead of `||` since its precedence would cause `app.config.ember.variant` to be used immediately (without ever checking `Rails.env`).