Skip to content

Loading…

use the new scope syntax on the tests to avoid DEPRECATION WARNINGS. #5556

Merged
merged 1 commit into from

3 participants

@rafaelfranca
Ruby on Rails member

No description provided.

@lest lest commented on an outdated diff
activesupport/lib/active_support/rescuable.rb
@@ -108,7 +108,11 @@ def handler_for_rescue(exception)
when Symbol
method(rescuer)
when Proc
- Proc.new { |*args| instance_exec(*args, &rescuer) }
+ if rescuer.arity == 0
+ Proc.new { instance_exec(&rescuer) }
+ else
+ Proc.new { |args| instance_exec(args, &rescuer) }
@lest
lest added a note

I think it's better to use *args here:

Proc.new { |*args| instance_exec(*args, &rescuer) }

Or use different argument name, e.g.:

Proc.new { |exception| instance_exec(exception, &rescuer) }
@rafaelfranca Ruby on Rails member

Hey @lest. This proc always receive only one argument, the exception. So I'll change to the second option. Thanks to review.

@lest
lest added a note

Piotr aready did it in d1887d3

@rafaelfranca Ruby on Rails member

Hahha. Thanks as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@rafaelfranca
Ruby on Rails member

Well I changed my pull request to remove only the warning now.

@drogus
Ruby on Rails member

Sorry, I forgot to went through pull requests before fixing the build

@drogus drogus closed this
@drogus drogus reopened this
@drogus drogus merged commit 9a26c90 into rails:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 23, 2012
  1. @rafaelfranca

    Use the new scope syntax

    rafaelfranca committed
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/test/fixtures/reply.rb
View
2 actionpack/test/fixtures/reply.rb
@@ -1,5 +1,5 @@
class Reply < ActiveRecord::Base
- scope :base
+ scope :base, -> { scoped }
belongs_to :topic, :include => [:replies]
belongs_to :developer
Something went wrong with that request. Please try again.