Slide 1

Slide 1 text

ϓϩΛ໨ࢦ͢3BJMTΤϯδχΞͷͨΊͷ ެ։ίʔυϨϏϡʔ גࣜձࣾιχοΫΨʔσϯ ҏ౻३Ұ 3BJMT%FWFMPQFST.FFUVQ

Slide 2

Slide 2 text

ABOUT ME ҏ౻३Ұ ➤ େࡕ෎๛தࢢग़਎ ➤ ฌݿݝ੢࿬ࢢࡏॅ ➤ גࣜձࣾιχοΫΨʔσϯ ➤ 3BJMTϓϩάϥϚ ➤ ϦϞʔτϫʔΧʔ ➤ Ϊλʔ޷͖ ➤ ࠓ೔.BUFVT"TBUP؍͖ͯͨʂ

Slide 3

Slide 3 text

͜Μͳͱ͜ΖʹॅΜͰ·͢

Slide 4

Slide 4 text

Έͳ͞Μ͸ࠓͲ͜ʹʁ #railsdm ͰπΠʔτʂ

Slide 5

Slide 5 text

ͪ͜Βͷ࢓ࣄ෦԰͔Β์ૹதͰ͢

Slide 6

Slide 6 text

πΠʔτΛνΣοΫʂ IUUQTUXJUUFSDPNIBTIUBHSBJMTEN TSDIBTI

Slide 7

Slide 7 text

޷ධൃചதʂ &WFSZEBZ3BJMT
 34QFDʹΑΔ3BJMTςετೖ໳ ➤ 3BJMTͰςετΛॻ͘ͳΒ͜Εʂ ➤ ߋ৽͕͋Ε͹ແྉΞοϓσʔτ ➤ 3BJMT൛΋຋༁͢Δ༧ఆ ➤ &16#ɺ.PCJɺ1%'ʹରԠ ➤ -FBOQVCͷ8FCαΠτͰൢചத

Slide 8

Slide 8 text

ٕज़ॻ͕ग़·͢ʂ ʮϓϩΛ໨ࢦ͢ਓͷͨΊͷ3VCZೖ໳ʯ ➤ ҏ౻३Ұஶ ➤ ೥݄ൃച ➤ #มܕ൑ϖʔδ ➤ ग़൛ࣾɿٕज़ධ࿦ࣾ ˞্ه಺༰͸ݱ࣌఺ͷ༧ఆͰ͢ɻ ͲΜͳຊͳͷʁ ➤ 2JJUB౳Ͱఆධͷ͋Δஸೡͳղઆ ➤ 5%%ˍνϡʔτϦΞϧܗࣜͷྫ୊ ➤ ։ൃͷݱ৔Ͱ໾ཱͭ஌͕ࣝຬࡌ ϓϩΛ໨ࢦ͢ਓͷͨΊͷ 3VCZೖ໳ ҏ౻३Ұஶ ٕज़ධ࿦ࣾ

Slide 9

Slide 9 text

ࠓճͷ͓୊͸͜ͷຊͷྫ୊ΛϞσΟϑΝΠ ʮୈ̓ষΫϥεͷ࡞੒Λཧղ͢ΔʯΑΓൈਮ

Slide 10

Slide 10 text

ຊ೔ͷΞδΣϯμ

Slide 11

Slide 11 text

ຊ೔ͷΞδΣϯμ ➤ ެ։ίʔυϨϏϡʔɾͦͷ̍ ➤ ެ։ίʔυϨϏϡʔɾͦͷ̎ ➤ ग़୊ऀͷղ౴ྫ ➤ ؾʹͳͬͨϙΠϯτ͋Ε͜Ε ➤ ·ͱΊ ➤ ࣭ٙԠ౴ʢ͕࣌ؒ͋Ε͹ʣ ➤ ࣭໰΍͝ҙݟ͸SBJMTENΛ෇͚ͯπΠʔτ ➤ ΈΜͳͰʮྑ͍ίʔυʯʹ͍ͭͯҰॹʹߟ͑ͯΈ·͠ΐ͏ʂ

Slide 12

Slide 12 text

ίʔυϨϏϡʔຊ໨

Slide 13

Slide 13 text

̍ຊ໨ͷίʔυϨϏϡʔ͸ͪ͜Βʂ IUUQTHJUIVCDPN+VOJDIJ*UPUSBJOUJDLFUSBJMTQVMM

Slide 14

Slide 14 text

ίʔυϨϏϡʔຊ໨

Slide 15

Slide 15 text

̎ຊ໨ͷίʔυϨϏϡʔ͸ͪ͜Βʂ IUUQTHJUIVCDPN+VOJDIJ*UPUSBJOUJDLFUSBJMTQVMM

Slide 16

Slide 16 text

ग़୊ऀͷղ౴ྫ

Slide 17

Slide 17 text

๻ͷղ౴ྫͰ͢ IUUQTHJUIVCDPN+VOJDIJ*UPUSBJOUJDLFUSBJMTDPNQBSFNBTUFSBOTXFS

Slide 18

Slide 18 text

ؾʹͳͬͨ఺͋Ε͜Ε

Slide 19

Slide 19 text

࢖༻ࡁΈͷ੾ූʁ

Slide 20

Slide 20 text

࢖༻ࡁΈͷ੾ූΛද͢ίʔυ 1. OJMͰͳ͚Ε͹ਅ ➤ redirect_to ʙ if @ticket.exited_gate 2. QSFTFOU Ͱʮʙ͕ଘࡏ͍ͯ͠Ε͹ʯΛ໌ࣔ ➤ redirect_to ʙ if @ticket.exited_gate.present? 3. ΠϯελϯεϝιουΛ࡞ͬͯந৅Խ ➤ redirect_to ʙ if @ticket.used? ➤ ύλʔϯ͕̏ಡΈखʹҰ൪΍͍͞͠

Slide 21

Slide 21 text

ʁͰऴΘΔϝιουͷ੹຿

Slide 22

Slide 22 text

ʁͰऴΘΔϝιουͷ੹຿Λߟ͑Δ ➤ before_action :ticket_used? ➤ validate :can_exit? ➤ ྫɿIUUQTHJUIVCDPN+VOJDIJ*UPUSBJOUJDLFUSBJMTQVMM ➤ ಛఆͷ৚݅ͰϦμΠϨΫτ͢Δʢ͍͍ͷʁʣ ➤ ಛఆͷ৚݅ͰΤϥʔϝοηʔδΛ௥Ճ͢Δʢ͍͍ͷʁʣ ➤ ʁͰऴΘΔϝιου͸ਅِ஋Λฦ͚ͩ͢ʹ͢Δ ➤ ͦΕҎ֎ͷ෭࡞༻͸࣋ͨͤͳ͍ ➤ ྫ֎ɿ"DUJWF3FDPSEͷWBMJE ϝιου

Slide 23

Slide 23 text

redirect_to + returnʁ

Slide 24

Slide 24 text

redirect_to + return ͷ return ͍ͬͯΔʁ ➤ ͦͷSFUVSOɺ͍Γ·͢ʁʢ͍Γ·ͤΜʂʣ def abort_used_ticket if @ticket.used? rediect_to root_path return end end

Slide 25

Slide 25 text

redirect_to + return ͷ return ͍ͬͯΔʁ ➤ ͨͩ͠ɺ࣍ͷΑ͏ͳίʔυͳΒSFUVSO͸ඞཁ def abort_used_ticket if @ticket.used? rediect_to root_path # Avoid DoubleRenderError return end redirect_to foo_path end SFEJSFDU@UP΍SFOEFSΛෳ਺ճݺͿͱ%PVCMF3FOEFS&SSPS

Slide 26

Slide 26 text

·ͱΊ

Slide 27

Slide 27 text

·ͱΊ ➤ ϝιουͷ੹຿Λߟ͑Α͏ ➤ ੹຿΍෭࡞༻͸Ͱ͖Δ͚ͩগͳ͘ ➤ ͍͍ײ͡ʹந৅Խ͠Α͏ ➤ ʮҙਤΘ͔ΔϩδοΫʯΑΓ΋ʮҙਤ͕෼͔Δ໊લʯΛ ➤ ෆཁͳίϯςΩετΛͳͦ͘͏ ➤ ࡞ͬͨਓ͚͕ͩΘ͔ΔʮӅΕͨҙຯʯ͸ഉআ͢Δ ➤ 3BJMTͷػೳΛ࢖͍͜ͳͦ͏ ➤ γϯϓϧͰෆ۩߹ͷͳ͍ίʔυΛ໨ࢦͦ͏ ➤ ͔ͩΒɺ͓ޓ͍ʹίʔυϨϏϡʔ͓͋͠͏ʂʂ

Slide 28

Slide 28 text

THANK YOU FOR ALL! ➤ ղ౴Λૹͬͯ͘ΕͨΈͳ͞Μɺ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ IUUQTHJUIVCDPN+VOJDIJ*UPUSBJOUJDLFUSBJMTQVMMT

Slide 29

Slide 29 text

͔ͤͬ͘ͳͷͰɺ

Slide 30

Slide 30 text

શһʹίϝϯτ͠·͢ʂ

Slide 31

Slide 31 text

શһͷղ౴ʹίϝϯτ͠·͢ ➤ ͨͩ͠ςΩετͩͱେมͳͷͰɺޱ಄Ͱίϝϯτ͠·͢ ➤ ίʔυΛݟͳ͕Β๻͕ίϝϯτΛೖΕΔಈըΛ࡞Γ·͢ ➤ ಈը͕Ͱ͖ͨΒൃදࢿྉͷҰ෦ͱͯ͠ެ։ˍ௨஌͠·͢ ➤ ର৅͸ݱ࣌఺ͰૹΒΕ͖͍ͯͯΔશϓϧϦΫΤετ ָ͓͠Έʹʂʂ

Slide 32

Slide 32 text

͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ Twitter: !KODIJUP Blog: IUUQCMPHKOJUPDPN Qiita: IUUQRJJUBDPNKODIJUP Follow me!