#248 ✓resolved
Ken Collins

Updated NamedScope Patching

Reported by Ken Collins | September 29th, 2008 @ 08:25 PM

The old named_scope patches for 1.2.6 had issue. Basically it would remove the scope of the proxy owner at certain time. Very odd bug but I found it while creating my GroupedScope plugin and uses WillPaginate's named_scope patches in my 1.2.6 app.

This patch updates NamedScope to the latest an has two patch files for 1.2.6 and 2.0.4. I have even updated the rake test_all to use 2.0.4 and not 2.0.2. There is an odd bug when running the tests for 1.2.6, for some reason the mocha setup from its test case was triggering the ArrayPaginationTest to start loading fixtures. Since there were no table names, it had an argument error since Fixtures were converting nil to an empty string and table_names ended up looking like this [""]. See the full error below. My solution was to add an empty setup to the ArrayPaginationTest so that mocha would hit that.

Right now all tests are passing for all rails versions.

1) Error: test_argument_error_with_params_and_another_argument(ArrayPaginationTest): ArgumentError: interning empty string

/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/fixtures.rb:251:in `to_sym'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/fixtures.rb:251:in `create_fixtures'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/fixtures.rb:250:in `map'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/fixtures.rb:250:in `create_fixtures'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/base.rb:867:in `silence'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/fixtures.rb:248:in `create_fixtures'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/fixtures.rb:593:in `load_fixtures'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/fixtures.rb:547:in `setup'
/opt/local/lib/ruby/gems/1.8/gems/mocha-0.9.1/lib/mocha/test_case_adapter.rb:68:in `run'

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Everyone's favorite Ruby library for pagination of practically anything!

People watching this ticket

Attachments

Pages