Permalink
Browse files

switch from ember development to production based on rails environment

  • Loading branch information...
1 parent 44eedab commit 167de1fa68c9700d27bd4670183e6a7f83a2cc1e @tchak tchak committed Apr 9, 2012
@@ -12,7 +12,7 @@ def vendor_path
path = ::Rails.root.nil? ? '' : ::Rails.root.join('vendor/assets/javascripts/ember.js')
if !File.exists?(path)
- path = File.expand_path(File.join(__FILE__, '../../../../vendor/assets/javascripts/ember.js'))
+ path = File.expand_path(File.join(__FILE__, '../../../../vendor/assets/javascripts/production/ember.js'))
end
end
@@ -12,6 +12,14 @@ class Engine < ::Rails::Engine
app.assets.register_engine '.handlebars', Ember::Handlebars::Template
app.assets.register_engine '.hbs', Ember::Handlebars::Template
app.assets.register_engine '.hjs', Ember::Handlebars::Template
+
+ assets_path = File.expand_path(File.join(__FILE__, '../../../../vendor/assets/javascripts'))
+
+ if ::Rails.env.production?
+ app.assets.append_path File.join(assets_path, 'production')
+ else
+ app.assets.append_path File.join(assets_path, 'development')
+ end
end
end
end

0 comments on commit 167de1f

Please sign in to comment.