Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move cache_digests rake methods into their own namespace #17069

Merged
merged 1 commit into from Feb 20, 2015
Merged

move cache_digests rake methods into their own namespace #17069

merged 1 commit into from Feb 20, 2015

Conversation

modosc
Copy link
Contributor

@modosc modosc commented Sep 26, 2014

we found a bug when running this task in our CI system:

RAILS_ENV="test" RACK_ENV="test" bundle exec rake db:create db:schema:load --trace

actionview/lib/action_view/tasks/dependencies.rake defines two methods that end up in the global namespace, and these shadowed an attribute with the same name (template_name) in a FactoryGirl factory:

FactoryGirl.define do
  factory :foo do
    template_name "blah"
  end
end

which resulted in this error:

ArgumentError: wrong number of arguments (1 for 0)
.../gems/actionview-4.1.6/lib/action_view/tasks/dependencies.rake:14:in `template_name'
.../spec/factories/foo.rb:3:in `block (2 levels) in <top (required)>'

to resolve i just stuck these in their own namespace but you might consider having a namespace just for rake first (RakeHelpers or something) and then putting this class inside that one. i'm guessing this isn't the only place where the global namespace is being polluted from a rake task.

@chollier
Copy link

chollier commented Oct 6, 2014

I had the exact same issue

rafaelfranca added a commit that referenced this pull request Feb 20, 2015
move cache_digests rake methods into their own namespace
@rafaelfranca rafaelfranca merged commit 14a6e17 into rails:master Feb 20, 2015
rafaelfranca added a commit that referenced this pull request Feb 20, 2015
move cache_digests rake methods into their own namespace
rafaelfranca added a commit that referenced this pull request Feb 20, 2015
move cache_digests rake methods into their own namespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants