rastam on rails

東京在住のマレーシア人 Rubyist

Ruby Weekly #477: 日本語サマリー

rubyweekly.com

Highlights

Ruby Next: A Way to Transpile Modern Ruby Code to Run on Ruby 2.5 or mruby?

他の Ruby バージョンの機能を使えるようにしてくれるトランスパイラー gem。

Isolating Rails Engines with RuboCop

Rails Engine 責務の混合を防ぐための RuboCop 集を作った Flexport 社。

10 New Things in Active Record (in Rails 6)

Rails 6 Active Record の新機能。

  1. rails db:prepare = rails db:setup + rails db:migrate
  2. rails db:seed:replant = TRUNCATE + rails db:seed
  3. 接続先(メイン DB or レプリカ DB)の自動判定
  4. enumnot_ スコープ
  5. .extract_associated = .preload + .map
  6. .annotateSQL コメント補足
  7. .touch_all
  8. .destroy_by.delete_by = .find_by + .destroy/.delete
  9. .where でも無限 Range 使えるようになった
  10. .implicit_order_column

Rails 6: The Missing Developer Setup Guide

Rails 開発者向け Rails 以外 の環境構築手順書集。

Articles & Tutorials

How to Update Counter Caches in Your Rails App Without Active Record Callbacks

ActiveRecord を拡張してくれる hair_trigger gem で SQL TRIGGER を活かす方法の紹介。

How I Approach Test Coverage Metrics

テストカバレッジ 100% ではなく、90% + メンテしやすい雰囲気を目指すべきだ、という簡潔な主張。

Working with Capistrano: Tasks, Roles, and Variables

Capistrano のカスタムタスク作成方法。SSH でサーバにログインして rails console を立ち上げるタスクを例に。

Code and Tools

Browser: A Browser Detection Library

ブラウザー検知 gem。

A Tetris Game Powered by Ruby2D

Ruby2D で実装されたテトリス。1 ファイル、200 LOC 未満。

Chatwoot: Simple, Open Source Live Chat Software

チャット用 OSS Rails アプリ。

Shrine 3.1: The File Attachment Toolkit for Ruby Webapps

添付ファイル用 gem。

Ruby Trello API: An Implementation of the Trello API for Ruby

Trello API クライアント用 gem。