Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Live with Rails
Oursky Limited
April 09, 2013
Programming
1
84
Live with Rails
My life with Rails and how I avoid it.
Oursky Limited
April 09, 2013
Tweet
Share
More Decks by Oursky Limited
See All by Oursky Limited
oursky
1
400
oursky
1
230
oursky
0
230
oursky
0
130
oursky
0
110
oursky
0
190
oursky
3
260
oursky
0
110
oursky
1
270
Other Decks in Programming
See All in Programming
minamijoyo
3
510
danilop
0
230
ianaya89
1
220
xrdnk
0
150
hanasuke
1
630
grapecity_dev
0
180
xrdnk
0
130
grapecity_dev
0
180
itok
1
760
watilde
5
1.4k
rince
3
240
saten
1
180
Featured
See All Featured
akmur
252
19k
stephaniewalter
260
11k
jmmastey
10
620
smashingmag
230
18k
danielanewman
200
20k
holman
288
130k
samlambert
237
10k
swwweet
206
6.9k
brettharned
93
3k
addyosmani
311
21k
carmenhchung
31
1.5k
mojombo
359
62k
Transcript
Live with Rails And avoid Rails Rick Mak, Apr 2013
Tuesday, 9 April, 13
Fact Rails is fast on creating MVP Rails is fast
on creating Restful API Rails has many stackoverflow articles. Tuesday, 9 April, 13
Getting big and getting away Rails is slow Test is
Rails is stupidly slow EdwinKwok says Rails is Architecture, not Entity: https://speakerdeck.com/oursky/ clean-code?slide=50 Tuesday, 9 April, 13
Heaven & Hell Tuesday, 9 April, 13
Requirement Both Project and User have quota Project may have
owner If a project has owner, ignore project quota If a project owner quota exceed, consider project quota. User can upgrade his quota Tuesday, 9 April, 13
Your Rails model Project User Project Quota User Quota Tuesday,
9 April, 13
Where is the Logic? Tuesday, 9 April, 13
Fat ActiveRecords Tuesday, 9 April, 13
ActiveSupport::Concern http://blog.codeclimate.com/blog/2012/10/17/7-ways- to-decompose-fat-activerecord-models/ “Any application with an app/concerns directory is
concerning.” Tuesday, 9 April, 13
No Time! I really need test case when it about
$money$ I really need test case when I follow up fat AR. Tuesday, 9 April, 13
No more free project Boss Tuesday, 9 April, 13
Where to change Tuesday, 9 April, 13
Standalone project payment Boss Tuesday, 9 April, 13
My life Tuesday, 9 April, 13
Introduce Quota Project Quota & User Quota is for storage
only All logic belongs to Quota Tuesday, 9 April, 13
Quota is not AR It test against its rspec, it
is fast. One place to edit Tuesday, 9 April, 13
Result Tuesday, 9 April, 13
Architecture matters Around 5 ticket about resource protection against expire/archive/non-owner
will become trivial to fix after introducing Quota. Rails architecture is just a guideline. Tuesday, 9 April, 13