Upgrade to Pro — share decks privately, control downloads, hide ads and more …

【2018/09/18 Otemachi.rb#9】君(退会したユーザ)の名は。

Shu OGAWARA
September 18, 2018

【2018/09/18 Otemachi.rb#9】君(退会したユーザ)の名は。

2018/09/18のOtemachi.rb#9での発表資料です。久しぶりのRailsネタです。

Shu OGAWARA

September 18, 2018
Tweet

More Decks by Shu OGAWARA

Other Decks in Technology

Transcript

  1. ܅ ͷ ໊ ͸ ɻ ୀձͨ͠Ϣʔβ 0UFNBDIJSC 4IV0("8"3" !FYQBKQ 1IPUPCZ/FJM3PTFOTUFDI

    PO6OTQMBTI
  2. 1   !  

  3. Rails

  4.  n & %(@expajp) –   ! – 3

    – Ruby/Rails(1 • Project Euler 100  •  Vue.js+  – # ' " – *$ )
  5. CM

  6. View    

  7.     

  8.  n post creatornil    

  9.   

  10.  n  post      

    n DB posts   ! user_id  NULL "  0   #  
  11.  n  post      

    n DB posts   ! user_id  NULL "  0   #  
  12.  ,

  13.  n B83+,.02@A' " %  – ,.020 ;E(15*,47<: $#D=

     n View6-/)'C9 ? " %  &"  – View!6-/)'?   –  DRY>%
  14.   

  15.    

  16.     n &  #$  n

    '!" %
  17. N+1

  18. N+1 Q . L S 0 N Q . 11

    N+1 / Eager Loading  - Rails Webook https://ruby-rails.hatenadiary.com/entry/20141108/1415418367 ’’
  19. N+1 n        DB

      → 
  20. ٫Լʂ

  21. CTO

  22.    

  23.  n Active Record/. creator_id0 - * n Decorator,#4( 

    *&!)$+   " → post'%*&!)30$+ → DRY21 
  24. Active Record

  25. Decorator

  26. View

  27. 

  28.   

  29. ҟٞ͋Γʂ

  30. 

  31.  CH*-&0c$a2&16$ >TO@L&Kg\N MB/&K$ ;5&F Z$ [Ra2 VI% 43$QWU *-&P

    D$a2Gb# $  $ SY9X`d$=^!A]?(.+'),JE" $a2&<7:f_<$ The WyCash Portfolio Management System http://c2.com/doc/oopsla92.html heSY8TO - Wikipedia  ’’
  32.  n 06:?)<5DE n Decorator7*F2(>  +' [email protected]%  –

    "#! .   n gem9(,38C  – B/) & ;A3 $/= 
  33. NullUser, SystemUser  

  34.  n Decorator  Post creator   n User

    full_name  n Post NullUser, SystemUser –   full_name ! n creator  User, NullUser, SystemUser   
  35. User

  36. NullUser, SystemUser

  37. Post

  38.    !

  39.  n  DB5-6  & %!* #($).  –

    View,1  '!  n 70+4 "*/ 32
  40.    n )$ " !'(   n

    View#*%&   
  41.    1.   2.   

     3. NullUser, SystemUser
  42.     !

  43.   n ;&B5$ – ?< 12$'*/+-@ – full_nameA03 %

    n ;D  …… – 89" FE –  DRY" n ;&,(-.4=6,). C :$# >7 !
  44.  n (#&')!% #@ n Rails0-=   – *"$!,E?28DRYF<251A

      – I74C>6 n +3D 9:HJ;B  – /.G+3D