Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ActiveRecord Observers - RORLab Season 3-6
Search
seapy
May 11, 2013
Programming
49
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ActiveRecord Observers - RORLab Season 3-6
seapy
May 11, 2013
More Decks by seapy
See All by seapy
Lambda + S3 썸네일 생성 및 운영 - AWSKRUG 정기 세미나 (2016년 9월)
seapy
1
560
형태소 분석기를 적용한 elasticsearch 운영
seapy
0
480
Amazon ec2 container service 소개
seapy
0
92
boot2docker 사용시 컨테이너에서 생성한 데이터를 유지하기
seapy
0
86
Elasticsearch + fluentd for Log analysis
seapy
3
10k
ActiveRecord Associations(2) - RORLab Season 3-8
seapy
0
52
ActiveRecord Associations(1) - RORLab Season 3-7
seapy
0
73
ActiveRecord Callbacks - RORLab Season 3-5
seapy
0
50
Rails Database Migrations - RORLab Season 3-3
seapy
2
110
Other Decks in Programming
See All in Programming
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
130
The NotImplementedError Problem in Ruby
koic
1
870
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
150
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
110
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
Oxcを導入して開発体験が向上した話
yug1224
4
320
A2UI という光を覗いてみる
satohjohn
1
140
dRuby over BLE
makicamel
2
380
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
670
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
150
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
11
6k
さぁV100、メモリをお食べ・・・
nilpe
0
150
Featured
See All Featured
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
320
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Embracing the Ebb and Flow
colly
88
5.1k
The Curious Case for Waylosing
cassininazir
1
400
Chasing Engaging Ingredients in Design
codingconduct
0
220
The Cult of Friendly URLs
andyhume
79
6.9k
Fireside Chat
paigeccino
42
4k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
340
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Designing for Performance
lara
611
70k
GraphQLとの向き合い方2022年版
quramy
50
15k
Making the Leap to Tech Lead
cromwellryan
135
9.9k
Transcript
Active Record Observers Ror lab. season 3 - the 6th
round - May 11, 2013 ChangHoon Jeong(@seapy)
Contents • The Object Life Cycle • Validations Overview •
Validation Helpers • Common Validation Options • Conditional Validation • Custom Validations • Working with Validation Errors • Displaying Validation Errors in the View • Callbacks Overview • Available Callbacks • Running Callbacks • Skipping Callbacks • Halting Execution • Relational Callbacks • Conditional Callbacks • Callback Classes • Observers • Transaction Callbacks Validations Callbacks
Callback Classes • To reuse callback methods for other models
as an instance method a model object instance method
Callback Classes as a class method
Observers • Similar to callbacks • for the callbacks with
the code that isn’t directly related the model • without changing the code of the model • ex. sending confirmation email after user registration
Creating Observers
Registering Observers • config/application.rb • or config/environments
Sharing Observers as a model name
Transaction Callbacks • after_commit or after_rollback
감사합니다.