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

Rails 5.0.0.beta2 触ってみた

morizyun
March 20, 2016

Rails 5.0.0.beta2 触ってみた

M3 Tech Talk と ゆるびぃ会で発表してきました!#rails #ruby
M3 Tech Talk に興味ある人は気軽にメッセージください => https://twitter.com/zyunnosuke

http://yuruby.connpass.com/event/25620/
http://m3dev.github.io/

morizyun

March 20, 2016
Tweet

More Decks by morizyun

Other Decks in Technology

Transcript

  1. Rails 5.0.0.beta2 ৮ͬͯΈͨ
    ϞϦδϡϯ (@zyunnosuke)

    View full-size slide

  2. ࣗݾ঺հ
    ϞϦδϡϯ (@zyunnosuke)
    ʮञͱᔢͱRubyͱRailsͱʯॻ͍ͯ·͢ʂ
    (๑•̀Ŷ•́๑)✧

    View full-size slide

  3. Rails5 Measure Version Up!
    • ͍Α͍ΑRails ͷϝδϟʔɾόʔδϣϯΞοϓ
    • 2015/12/18 - 5.0.0.beta1 released
    • 2016/01/25 - 5.0.0.beta1.1 released
    • 2016/02/01 - 5.0.0.beta2 released ← ࠓίί
    • 2016/02/16ʙ23 - 5.0.0 rc1 release༧ఆ
    • ษڧ͕ͯΒ৽ػೳΛ৮ͬͯΈͨͷͰใࠂ

    View full-size slide

  4. Action Cable

    View full-size slide

  5. Action CableͬͯԿʁ
    • Action Cable͸WebSocketΛϋϯυϦϯ
    ά͢ΔͨΊͷϑϨʔϜϫʔΫ
    • ͪͳΈʹɺWebSocketͱ͸αʔόͱ

    ϒϥ΢βؒͰͷ૒ํ޲௨৴ͷϓϩτίϧ
    • νϟοτ΍NotificationΛRails WayͰ

    ؆୯ʹ࣮૷͢Δ͜ͱ͕Ͱ͖Δ

    View full-size slide

  6. νϟοτΞϓϦΛ࡞Ζ͏
    GeneratorͰͻͳܗΛੜ੒

    View full-size slide

  7. νϟοτΞϓϦΛ࡞Ζ͏
    ϧʔςΟϯάΛमਖ਼

    View full-size slide

  8. νϟοτΞϓϦΛ࡞Ζ͏
    JavaScriptଆΛमਖ਼

    View full-size slide

  9. νϟοτΞϓϦΛ࡞Ζ͏
    ActionCableͷΫϥεΛ࡞੒

    View full-size slide

  10. νϟοτΞϓϦΛ࡞Ζ͏
    MessageΛςʔϒϧʹอଘɺඇಉظͰJobΛىಈ

    View full-size slide

  11. νϟοτΞϓϦΛ࡞Ζ͏
    อଘ͞ΕͨϝοηʔδΛඇಉظͰ഑৴

    View full-size slide

  12. νϟοτΞϓϦΛ࡞Ζ͏
    ͋ͱ͸ViewΛ࡞Δ͚ͩ

    View full-size slide

  13. νϟοτΞϓϦΛ࡞Ζ͏
    νϟοτΞϓϦ׬੒ ʕ•̀ω•́ʔ✧

    View full-size slide

  14. Action Cableͷײ૝
    • ViewͷΩϟογϡͳͲɺRailsͷࠓ·Ͱͷ

    ஌ࣝΛ༗ޮ׆༻Ͱ͖Δ
    • Ұ࣌తͳ઀ଓෆྑ΍Τϥʔ࣌ͷϦΧόϦ౳ɺ

    ຊ൪ద༻ʹ͸৭ʑߟ͑ͳ͍ͱ͍͚ͳͦ͏
    • Basecamp 3Ͱ͸طʹຊ൪ద༻ɻ͚Ͳɺωο
    τͷ஌ݟ͕ͨ·Δ·Ͱগ༷͠ࢠݟ͕͍͍͔΋
    http://morizyun.github.io/blog/rails-5.0.0.beta1-new-function-official-blog/

    View full-size slide

  15. API ModeͬͯԿʁ
    • ϓϩάϥϜ͕ΞΫηε͢Δ͜ͱΛલఏͱ
    ͨ͠JSON APIʹదͨ͠ΞϓϦ
    • Rails WayͰϏδωεϩδοΫΛεϐʔ
    σΟ͔ͭॊೈʹAPIΛߏஙͰ͖Δ

    View full-size slide

  16. API ModeͷϝϦοτ
    • ௨ৗͷWebΞϓϦΑΓ΋ɺMiddleware͕௨
    ৗΑΓ੍ݶ͞ΕΔ͜ͱͰԠ౴ੑೳ͕޲্͢Δ
    • GeneratorͰͷView΍Assetͷੜ੒͕ߦΘΕ
    ͳ͍(ϑϩϯτΤϯυଆ͕ߦ͏͜ͱΛ૝ఆ)
    • RailsͷϓϥΫςΟεΛͦͷ··࢖͍ͭ
    ͭɺੑೳ͕޲্͍ͯ͠ΔͷͰ࣮༻త
    http://morizyun.github.io/blog/rails-5.0.0.beta1-new-function-official-blog/

    View full-size slide

  17. ActiveRecord
    Attributes

    View full-size slide

  18. ActiveRecord Attributes
    DBʹอଘ͢ΔಠࣗͷܕΛ࣋ͭ͜ͱ͕Ͱ͖Δ
    http://morizyun.github.io/blog/rails-5.0.0.beta1-new-function-official-blog/

    View full-size slide

  19. ActiveRecord::
    Relation#or

    View full-size slide

  20. ActiveRecord::Relation#or
    orΛਖ਼֬ʹղऍͰ͖ΔΑ͏ʹͳͬͨ
    (ۙ೔தʹϒϩάެ։༧ఆ)

    View full-size slide

  21. ActiveRecord::Relation
    #left_outer_joins

    View full-size slide

  22. #left_outer_joins(#left_joins)
    ֎෦݁߹Λߦ͏ #left_outer_joins(#left_joins)
    (ۙ೔தʹϒϩάެ։༧ఆ)

    View full-size slide

  23. Enumerable
    #pluck

    View full-size slide

  24. Enumerable#pluck
    Enumerable͔ΒɺಛఆͷཁૉΛநग़
    (ۙ೔தʹϒϩάެ։༧ఆ)

    View full-size slide

  25. Enumerable
    #without

    View full-size slide

  26. Enumerable#without
    Enumerable͔ΒಛఆͷཁૉΛऔΓআ͘
    (ۙ೔தʹϒϩάެ։༧ఆ)

    View full-size slide

  27. Change Log
    (ۙ೔தʹϒϩάެ։༧ఆ)
    • ActionPack CHANGELOG
    • ActionMailer CHANGELOG
    • ActionView CHANGELOG
    • ActiveRecod CHANGELOG
    • ActiveModel CHANGELOG
    • ActiveSupport CHANGELOG
    • ActiveJob CHANGELOG
    • Railties CHANGELOG

    View full-size slide

  28. ·ͱΊ
    • Action Cable => νϟοτ࡞Γ΍ͦ͢͏
    • API Mode => APIΛ࡞Γ͸͡Ί΍ͦ͢͏
    • ͦͷଞ͍Ζ͍Ζ => ஍ຯͳਐԽ͕خ͍͠

    View full-size slide