Actions defined using resource get bypass the controller #7910

Closed
rubys opened this Issue Oct 11, 2012 · 9 comments

Comments

Projects
None yet
4 participants
Contributor

rubys commented Oct 11, 2012

Simple reproduction scenario

Changing the controller method to log or do something that will fail (like call an undefined method) shows that the method is never called.

Originally seen as a part of the Agile Web Development with Rails tests

d695fdb is the first commit showing the failure
a8f6d5c is the last commit where the scenario passes

Contributor

georgebrock commented Oct 21, 2012

I've followed @rubys' scenario and I couldn't reproduce the issue using any of the following versions of Rails, and various versions of the dependancies:

  • The master branch (currently at cec66e5)
  • The commit that apparently introduced the issue (d695fdb)
  • The commit mentioned at the bottom of the scenario (cd98c25).

For the two tests with older versions of Rails I modified the Gemfile of my test application to make sure I was using the exact same revisions of the gems that are installed from GitHub as had been used in @rubys' original test (using the bundle show output at the bottom of his scenario). I also tried running these with the newest versions of the dependancies that were compatible with those versions of Rails.

For the master test I used the default Gemfile generated by rails new --dev, which points to the latest versions of everything on GitHub.

Member

steveklabnik commented Oct 21, 2012

Hmm. @rubys, it seems like the AWDwR tests haven't been run in a while, is that true?

Contributor

rubys commented Oct 21, 2012

AWDwR are definitely still running: http://intertwingly.net/projects/dashboard.html

I tried running /home/rubys/git/rails/railties/bin/rails new depot --dev from the command line, and got:

Updating git://github.com/rails/coffee-rails.git
Fetching gem metadata from https://rubygems.org/.
Error Bundler::HTTPError during request to dependency API
Fetching full source index from https://rubygems.org/
Using rake (0.9.2.2) 

And then running rails generate scaffold Product title:string produces:

/home/rubys/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find railties (>= 0) amongst [active_utils-1.0.5, activemerchant-1.28.0, activesupport-3.2.8, ansi-1.4.3, arel-2.2.3, bcrypt-ruby-3.0.1, builder-3.1.4, builder-3.0.4, bundler-1.2.1, capistrano-2.13.4, coffee-script-2.2.0, coffee-script-source-1.3.3, erubis-2.7.0, execjs-1.4.0, haml-3.1.7, highline-1.6.15, hike-1.2.1, htmlentities-4.3.1, i18n-0.6.1, jquery-rails-2.1.3, json-1.7.5, kaminari-0.14.1, mail-2.4.4, mail-2.3.3, mime-types-1.19, minitest-4.1.0, money-5.0.0, multi_json-1.3.6, multi_json-1.2.0, mysql2-0.3.11, net-scp-1.0.4, net-sftp-2.0.5, net-ssh-2.6.1, net-ssh-gateway-1.1.0, nokogiri-1.5.5, polyglot-0.3.3, rack-1.4.1, rack-1.3.6, rack-cache-1.2, rack-mount-0.8.3, rack-ssl-1.3.2, rack-test-0.6.2, rake-0.9.2.2, rdoc-3.12, rubygems-bundler-1.1.0, rvm-1.11.3.5, sass-3.2.1, sprockets-2.8.0, sprockets-2.0.4, sqlite3-1.3.6, test-unit-2.5.2, thor-0.16.0, thor-0.14.6, tilt-1.3.3, treetop-1.4.11, turbolinks-0.5.1, turn-0.8.3, tzinfo-0.3.33, uglifier-1.3.0, will_paginate-3.0.3] (Gem::LoadError)
from /home/rubys/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /home/rubys/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
from /home/rubys/.rvm/gems/ruby-1.9.3-p286/bin/rails:22:in `<main>'

Can somebody share a Gemfile that does work with a recent clone of Rails master?

Contributor

georgebrock commented Oct 21, 2012

Hi @rubys,

This is the Gemfile I used with Rails cd98c25 and d695fdb to try and reproduce your test setup https://gist.github.com/3927199

When I was trying to reproduce the bug against master I had no problem with the Gemfile that was generated by rails new. The exact commands I used were:

rails/railties/bin/rails new issue7910 --skip-bundle --dev
cd issue7910
bundle install --path .bundle
bundle exec rails g scaffold Product title:string
rake db:migrate
bundle exec rails s
Member

steveklabnik commented Oct 21, 2012

Ah, awesome, I was looking in the wrong place. :(

Member

steveklabnik commented Oct 21, 2012

Error Bundler::HTTPError during request to dependency API

Yeah, the RubyGems dependency API is down.

Contributor

rubys commented Oct 21, 2012

Indeed it was my problem:

rubys/awdwr@3d20d7a

Explanation: the upside of having an automated test suite is that is can tell quickly and with precision what commit caused the results to change. The downside of an automated test suite is that it doesn't have common sense. In this case it correctly identified the Rails commit that caused the change, but that's not the complete story. Adding a method at the end of the class used to work, but doesn't any more as there now is a private section. :-P

@rubys rubys closed this Oct 21, 2012

Member

steveklabnik commented Oct 22, 2012

:D awesome.

Owner

guilleiguaran commented Oct 22, 2012

❤️

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