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
Rails Maintainance Headaches
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
pete higgins
July 03, 2013
Programming
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rails Maintainance Headaches
pete higgins
July 03, 2013
More Decks by pete higgins
See All by pete higgins
Help Seattle.rb
phiggins
0
93
Rails Archeology
phiggins
2
130
Webmock
phiggins
0
82
Ruby Stdlib's Benchmark
phiggins
0
72
Hacking Ruby
phiggins
3
220
Lightweight Objects Seattle.rb
phiggins
1
88
Cute Animals You've Never Heard Of
phiggins
0
490
Other Decks in Programming
See All in Programming
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
140
CSC307 Lecture 17
javiergs
PRO
0
320
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
270
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
150
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
1
260
C# and C++ Interoperability - cho-dotnetnew
harukasao
0
290
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.3k
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
350
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
210
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
120
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
410
Featured
See All Featured
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
200
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
270
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Bash Introduction
62gerente
615
220k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
160
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
250
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
210
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2k
It's Worth the Effort
3n
188
29k
Transcript
Rails Bad Practices Pete Higgins Seattle.rb
Me twitter: @pete_higgins github: @phiggins
Not me
Not me
Me
Me
“Why should I listen to you?”
What this isn't * An excuse to bash Rails *
Performance optimization * Comprehensive
What this isn't * An excuse to bash Rails *
Performance optimization
What this isn't * An excuse to bash Rails *
Performance optimization * A comprehensive list
Comprehensive * I am not a ZOMG Expert
Comprehensive * I am not a ZOMG Expert * “Do
these things and your code is fixed”
“Then what is this about?”
DHH Inventor of Rails and race cars. Original screencast: http://rubyonrails.ytmnd.com/
High level things I am obligated to mention
Comments
Cleverness Widget. where(foo_id:id). pluck(:timestamp). map(&:to_i). reduce(:-). abs
Debugging this ¯\_( ツ )_/¯
Cleverness Widget. where(foo_id:id). pluck(:timestamp). map(&:to_i). reduce(:-). abs
Resources are database models
Resources are not necessarily database models
Resources resource :profile, only: [:edit, :update] do member do get
'photo' => 'profile#edit_photo' post 'photo' => 'profile#update_photo' get 'crop_photo' end end
Resources resource :photo, only: [:edit, :create] resource :profile, only: [:edit,
:update]
Resources
Resources
Resources * Do one thing in controller / actions.
Cleverness * ActiveRecord callbacks. * Observers.
Resources * Do one thing in controller / actions. *
Delegate to other objects.
Models * Service Objects, Factories, Builders, non-ActiveRecord models.
Remove logic from views * Use view objects, presenters, form
objects, decorators, etc.
Use Ruby * What you call it isn't important. *
Not everything has to be a controller, model, helper or view.
Avoid @ivars def page @page ||= params[:page] || 1 end
private :page helper_method :page
Avoid @ivars def page @page ||= params[:page] || 1 end
private :page helper_method :page * rubygems.org/gems/ decent_exposure
None
Questions? twitter: @pete_higgins github: @phiggins