Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ActiveRecord Observers - RORLab Season 3-6
Search
seapy
May 11, 2013
Programming
56
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
Transcript
10 slides
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
감사합니다.
More Decks by seapy
See All by seapy
Lambda + S3 썸네일 생성 및 운영 - AWSKRUG 정기 세미나 (2016년 9월)
seapy
1
560
형태소 분석기를 적용한 elasticsearch 운영
seapy
0
490
Amazon ec2 container service 소개
seapy
0
100
boot2docker 사용시 컨테이너에서 생성한 데이터를 유지하기
seapy
0
94
Elasticsearch + fluentd for Log analysis
seapy
3
10k
ActiveRecord Associations(2) - RORLab Season 3-8
seapy
0
55
ActiveRecord Associations(1) - RORLab Season 3-7
seapy
0
76
ActiveRecord Callbacks - RORLab Season 3-5
seapy
0
57
Rails Database Migrations - RORLab Season 3-3
seapy
2
110
Other Decks in Programming
See All in Programming
小さなアプリを作って公開するまで
onozaty
0
240
Debian JP Projectのサーバー構成
uwabami
1
170
Kotlin JVM用に作られたライブラリのKMPを前提とした再設計
jsoizo
0
230
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
190
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
210
地方こそサーバーレス — 10年続けた、顔が見えるチームで確かな基盤を / Serverless Matters Most in Regional Areas — 10 Years of Building Reliable Foundations with Close-Knit Teams
seike460
PRO
2
510
LLM 101
dalinaum
0
530
protojson における文字化けの扱い
kazuki1023
0
460
Going Full Circle with Virtual Graphs and Relational Databases
michaelsimons
1
110
将来の標準フォーマッター?ktfmtを深堀る
t45k
0
250
はじめてのPLATEAU
nokonoko1203
1
670
AI時代のIaC入門 〜なぜインフラをコードで管理したいのか?〜 / Introduction to IaC in the AI Era
akihisaikeda
6
1.6k
Featured
See All Featured
Navigating Team Friction
lara
192
16k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Rails Girls Zürich Keynote
gr2m
96
14k
Automating Front-end Workflow
addyosmani
1370
210k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Building the Perfect Custom Keyboard
takai
2
970
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
The Invisible Side of Design
smashingmag
301
52k
Ruling the World: When Life Gets Gamed
codingconduct
0
450
Claude Code のすすめ
schroneko
67
230k
Accessibility Awareness
sabderemane
1
310
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
620