File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -498,9 +498,10 @@ def self.build(filter, callback)
498
498
when Conditionals ::Value
499
499
ProcCall . new ( filter )
500
500
when ::Proc
501
- if filter . arity > 1
501
+ case filter . arity
502
+ when 2
502
503
InstanceExec2 . new ( filter )
503
- elsif filter . arity > 0
504
+ when 1 , - 2
504
505
InstanceExec1 . new ( filter )
505
506
else
506
507
InstanceExec0 . new ( filter )
Original file line number Diff line number Diff line change @@ -189,6 +189,8 @@ class ConditionalPerson < Record
189
189
before_save Proc . new { |r | r . history << "b00m" } , if : Proc . new { |r | false }
190
190
before_save Proc . new { |r | r . history << [ :before_save , :proc ] } , unless : Proc . new { |r | false }
191
191
before_save Proc . new { |r | r . history << "b00m" } , unless : Proc . new { |r | true }
192
+ before_save Proc . new { |r | r . history << "b00m" } , unless : proc ( &:history )
193
+ before_save Proc . new { |r | r . history << "b00m" } , unless : lambda ( &:history )
192
194
# symbol
193
195
before_save Proc . new { |r | r . history << [ :before_save , :symbol ] } , if : :yes
194
196
before_save Proc . new { |r | r . history << "b00m" } , if : :no
You can’t perform that action at this time.
0 commit comments