Fix GH #5411. When precompiling, params method is undefined. #5525

Merged
merged 1 commit into from Mar 22, 2012

Conversation

Projects
None yet
3 participants
Contributor

kennyj commented Mar 20, 2012

If we execute assets:precompile, params method is undefined.
But ruby can't judge that params is method (or localvariable). Thus we should rescue NameError.

Please see #5411

BTW: NoMethodError's superclass is NameError.

Contributor

kennyj commented Mar 20, 2012

I send PR to 3-2-stable, because we don't have rails_helper.rb on master.
I think that we should fix rails/sprockets-rails.

/cc @guilleiguaran

Owner

guilleiguaran commented Mar 22, 2012

@kennyj why the test is in asset_debugging_test.rb instead of assets_test.rb? it's failing only when debugging is on?

Contributor

kennyj commented Mar 22, 2012

@guilleiguaran You're right. I thought the original problem was related to debug, so I wrote in asset_debugging_test.rb. But now I think that this one wasn't related to it. I'll move it to assets_test.rb.

Contributor

kennyj commented Mar 22, 2012

done.

Owner

guilleiguaran commented Mar 22, 2012

@spastorino @josevalim please review this

Contributor

josevalim commented Mar 22, 2012

👍 @guilleiguaran can you port to it to sprockets-rails gem as well? thanks.

Contributor

kennyj commented Mar 22, 2012

I sent a PR to sprockets-rails (for rails master).
rails/sprockets-rails#1

josevalim added a commit that referenced this pull request Mar 22, 2012

Merge pull request #5525 from kennyj/fix_5411
Fix GH #5411. When precompiling, params method is undefined.

@josevalim josevalim merged commit b714140 into rails:3-2-stable Mar 22, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment