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

Rails 6.0の気になった新機能 #shuuumai

Rails 6.0の気になった新機能 #shuuumai

『【シューマイ】Tech Lead Engineerから最新技術を学べ!Rails編×station』
https://shuuu-mai.connpass.com/event/146313/

Hiroaki Ninomiya

October 09, 2019
Tweet

More Decks by Hiroaki Ninomiya

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ • treby(ͱΕͼʔ) a.k.a Hiroaki Ninomiya • Reproגࣜձࣾ BizDevࣄۀ෦ •

    Solution Architect • BtoB SaaSاۀ • ৬ۀΤϯδχΞͷΩϟϦΞΛߟ͑Δɺʮ͖ͷ͜ΔΤϑΤϜʯ΍͍ͬͯ·͢ • Vue Fes Japan 2019 ίΞελοϑ(୆෩)
  2. Reproגࣜձࣾ • 2014೥ઃཱͷελʔτΞοϓاۀ • https://repro.io/ • BtoB SaaS • ࣗࣾϓϩμΫτRepro

    SDKΛ։ൃ • ϞόΠϧΞϓϦͷ෼ੳɾϚʔέςΟϯά༻్ • ಛఆηάϝϯτʹ؆୯ʹϓογϡ௨஌͕ଧͯΔ • ݱࡏɺઈࢍٸ੒௕த
  3. Solution Architect • Bizdev -> ʮࣄۀ੒௕ΛՃ଎ͤ͞Δʯ࢓ࣄ • https://note.mu/saas_bizdev/n/ncd38d86262f4 • BizDevͷSolution

    Architect • ཁ݅ఆٛΛ͢ΔΑΓߋʹલ͔ΒೖΔ • ސ٬ͷཁٻཧղɺ࿈ܞީิπʔϧͱͷίϛϡχέʔγϣϯ • ࿈ܞͷ͋Δ΂͖ʹ͍ͭͯɺϩʔυϚοϓΛҾ͖ɺ࣮ߦ͢Δ • هࣄॻ͍ͨͷͰΑ͚Ε͹: https://tech.repro.io/entry/2019/08/21/174705
  4. rails routesग़ྗΛ֦ுϑΥʔϚοτ ͰදࣔͰ͖Δػೳ • rails routes --expanded ͱॻ͘ͱීஈͷςʔϒϧϑΥʔϚοτͰͳ ͘ৄࡉͳද͕ࣔͳ͞ΕΔ •

    େن໛ΞϓϦέʔγϣϯͷRoutesͷߜΓࠐΈ͕Ͱ͖Δ΋ͷ͸ͳ ͍ͷ͔ • ࣮͸ -g Φϓγϣϯ͕͋ͬͨɺ஌Βͳ͔ͬͨ • https://github.com/rails/rails/pull/23225 ɺ2016೥ Rails 5 ͔Β
  5. ͢΂ͯͷenum஋ʹ͍ͭͯωΨςΟϒ είʔϓΛ௥Ճ • https://github.com/rails/rails/pull/35381 • λΠτϧ͚ͩͰ͸Կͷ͜ͱ͔෼͔Βͳ͍Ͱ͕͢ class Post < ActiveRecord::Base

    enum status: [:drafted, :active, :trashed] end • Post.not_drafted Έ͍ͨͳࢦఆ͕Ͱ͖ΔΑ͏ʹͳΔ • ݸผʹscope੾͍ͬͯͨͷ͕ෆཁʹͳΔ • ͦ΋ͦ΋enum͕޷͖͔Ͳ͏͔ͱ͍͏ͷ͸͋Γ·͕͢ɺɺɺ
  6. ஍ຯʹخ͍͠ / ࢖͑ͦ͏ͳ͋Ε΍͜Ε΍ • Truncateͷαϙʔτ • https://github.com/rails/rails/pull/34779 • Ruby 2.6Ͱಋೖ͞ΕͨΤϯυϨεrangeΛ#whereͰαϙʔτ

    • https://github.com/rails/rails/pull/34779 • #inspectͷݸਓ৘ใσʔλΛϑΟϧλͰআ֎͢ΔػೳΛ௥Ճ • https://github.com/rails/rails/pull/34208