Browse files

Remove old call to sprockets context

  • Loading branch information...
1 parent 3773aa4 commit 59baf2fc9c5e7aaf56cf36fdd70d9ecbc7a4a336 @josh josh committed May 17, 2011
Showing with 1 addition and 9 deletions.
  1. +1 −9 actionpack/lib/sprockets/railtie.rb
10 actionpack/lib/sprockets/railtie.rb
@@ -34,15 +34,7 @@ def self.using_scss?
app.assets = asset_environment(app)
ActiveSupport.on_load(:action_view) do
- if app.assets.respond_to?(:context_class)
- context = app.assets.context_class
- # TODO: Remove this condition when Sprockets 2.0.beta.3 is released
- else
- context = app.assets.context
- end
- context.instance_eval do
+ app.assets.context_class.instance_eval do
include ::ActionView::Helpers::SprocketsHelper

3 comments on commit 59baf2f

Ruby on Rails member

I found Rails 3.1.0.beta1 gem stopped working due to this update on Sprockets.

% rails -v
Rails 3.1.0.beta1

% rails new sprockets_b3_fail
% cd sprockets_b3_fail

% bundle show sprockets

% grep sprockets Gemfile.lock
      sprockets (~> 2.0.0.beta.2)
    sprockets (2.0.0.beta.3)

% rails c
/Users/a_matsuda/.rvm/gems/ruby-1.8.7-p334/gems/actionpack-3.1.0.beta1/lib/sprockets/railtie.rb:37: undefined method `context' for #<Sprockets::Environment:0x10399a850> (NoMethodError)
    from /Users/a_matsuda/.rvm/gems/ruby-1.8.7-p334/gems/activesupport-3.1.0.beta1/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
Ruby on Rails member

Rails master is ~> beta.3

Ruby on Rails member

I know. That's why I said "Rails 3.1.0.beta1 gem stopped working".
Actually, every time I bundle update on edge, it bundles sprockets beta.3 and makes my new 3.1.beta1 app unbootable.
But it's OK because the gem is "beta" and the next one seems to be coming soon.
I mean, I don't think you should fix something, but just wanted to let you know the situation.

Please sign in to comment.