Skip to content
This repository
Browse code

Add better test scenario for around callback return results

  • Loading branch information...
commit 9798ee2619154de5b2f052735d1ec80c47857178 1 parent df615f1
Aaron Pfeifer obrie authored josevalim committed

Showing 1 changed file with 10 additions and 0 deletions. Show diff stats Hide diff stats

  1. +10 0 activesupport/test/callbacks_test.rb
10 activesupport/test/callbacks_test.rb
@@ -303,12 +303,22 @@ def save
303 303 class AroundPersonResult < MySuper
304 304 attr_reader :result
305 305
  306 + set_callback :save, :after, :tweedle_1
306 307 set_callback :save, :around, :tweedle_dum
  308 + set_callback :save, :after, :tweedle_2
307 309
308 310 def tweedle_dum
309 311 @result = yield
310 312 end
  313 +
  314 + def tweedle_1
  315 + :tweedle_1
  316 + end
311 317
  318 + def tweedle_2
  319 + :tweedle_2
  320 + end
  321 +
312 322 def save
313 323 run_callbacks :save do
314 324 :running

0 comments on commit 9798ee2

Please sign in to comment.
Something went wrong with that request. Please try again.