class User
def before_save
puts 'before save'
end
def after_save
puts 'after_save'
end
def around_save
puts 'in around save'
yield
puts 'out around save'
end
end
User.save
before save
in around save
out around save
after_save
=> true
Tuesday, February 24, 2015
The around_* callback is called around the action and inside the before_* and after_* actions. For example:
Subscribe to:
Post Comments (Atom)
FastAPI: The Modern Python Web Framework
Introduction to FastAPI: The Modern Python Web Framework The world of web frameworks has always been competitive — from Django and Flask ...
-
# Object Oriented Programming : OOP is a method of programming.The main purpose of object oriented programming is that it simplify the ...
-
rspec is a full-featured testing framework that will let you write what Rails considers unit tests, functional tests, and integration test...
-
Cucumber – a Behavior Driven Development (BDD) framework which is used with Selenium for performing acceptance testing. Cucumber Introd...
No comments:
Post a Comment