RailsConf 2018: Keynote: The Future of Rails 6: Scalable by Default by Eileen Uchitelle
Everyday RailsのChapter 8「フィーチャスペック」を参考に作ってみます。 フィーチャスペック = 統合テスト モデルとコントローラの単体テスト、テストデータを作成するためのファクトリを全部まとめて、フィーチャテストを行う。 ちなみにコントローラテストについても議論されているけど、今回自分は書いていない。今回最初の段階でそこに大きな工数を割くことができないということと、フィーチャスペックをきちんと書けば複数の重要なコントローラのテストになりうるから。 テストはoutside-inで書く。つまり フィーチャスペック(エンドユーザがタスクを完了する流れを想定しながら) -> コントローラ・モデルテストの単体テスト という流れ。 書いてく 参考記事 Rails + RSpec + Capybara で Devise での認証ログインが必要なインテグレーションテスト(Reques
Rails is both easy to use—and also to misuse. Let’s look at 10 common Rails programming mistakes, explore their consequences, and discover ways to steer clear, as we write clean Ruby on Rails code. authors are vetted experts in their fields and write on topics in which they have demonstrated experience. All of our content is peer reviewed and validated by Toptal experts in the same field. Rails is
RailsをGKEで動かす際に参考にしたアプリケーションのリンク集です rails-docker GKE + mysql(CloudSQL) + puma + Sidekiq + Redis zaru/rails-docker 普通のRailsアプリをdockerで本番運用する知見 rails-on-kubernetes minikube + postgresql + Sidekiq + Redis Rails on Kubernetes - Part 1 Rails on Kubernetes - Part 2 Rails on Kubernetes - Part 3 tzumby/rails-on-kubernetes: Sample Rails application deployed with Kubernetes posgresの設定ファイルは参考になる rails-on-k
2018-04-25 MRI, the standard Ruby interpreter, has a serious problem with memory bloat in large Rails apps. It’s quite common for me to see Sidekiq processes which are 1-2GB in RSS or even larger! It turns out that a large part of this memory usage is due to memory fragmentation: MRI uses the OS’s memory allocator by default (on Linux, almost always GNU glibc), which seems to work poorly with Ruby
New ways to handle file uploads, share credentials with your team, set up Content Security Policy, even start your application—we are looking at what’s new in Rails 5.2 and focus on Active Storage with a step-by-step introduction to the new framework. Even though we did not get it as a promised New Year present and were just told to wait another month for the official release, Rails 5.2 was assign
Im my previous article I showed how you can use Rails 5 Attributes API with JSONB and value objects to improve the design of your application. Today I want to show you how Attributes API can be applied to refactor Primitive Obsession anti pattern. Primitive data types are the basic built-in building blocks of a language. They're usually typed as int, string, or constants. As creating such fields i
はじめに 最近RackサーバーをPumaに切り替えたこともあり、スレッドセーフのチェックをがんばっている日々。特定の条件で動的にcallbackをスキップしている箇所があるが、set_callback / skip_callbackはスレッドセーフでないので使えない。じゃあどうしたら良いのよ!?というのがきっかけで、skip_callbackと同等な動作をスレッドセーフでやる方法を調べてみた。 素朴な疑問(:callbacks => falseオプションが実装されていない経緯) ActiveRecordの作成・更新系のメソッドにはvalidationをスキップするオプションがある(:validate => false)。だったらそもそも、callbackをスキップするオプションだって実装されていても良いのでは?という素朴な疑問が浮かんだ。調べてみると、railsのPull Requestで
Terraform AWSのインフラ構成はTerraform管理してる. tfstateを分割する tfstateが1つのままだと、Terraformのresourceを増やしていったときに 頻繁に更新するresourceとそうでもないものがある 適応するのに時間が掛かる エラーの切り分けしずらくなる ということからtfstateを分割してる。 ただ分割しすぎると、適応漏れや適応順番が複雑になるので2つに分割してる。 . ├── environments │ ├── immutable │ │ ├── backend.tf │ │ ├── main.tf │ │ ├── provider.tf │ │ └── variable.tf │ └── mutable │ ├── backend.tf │ ├── main.tf │ ├── ou
手元で ActiveRecord を試したいときに、いちいちデータベースを用意したり、再現性のあるコード片に整えたりするのは、結構な手間に感じてしまうかもしれません。この記事では、そういったケースで利用できる知識を幾つかまとめておこうと思います。 以下は今回題材に使うコード例で、これを上から順に説明していきます。 ActiveRecord で .count の挙動を試す例bundler/inlinebundler/inline は Bundler 1.10 から追加された機能です。これを利用すると、Gemfile を独立したファイルとして用意することなく、スクリプトの中にその定義を埋め込めるようになります。 続くスクリプトがどのバージョンの Gem で動かせるのかということを明示でき、必要であればライブラリを実行時に自動的にインストールし、依存関係を調べて $LOAD_PATH を調整し、
Releases, Offers & More Be the first to hear about our newest content, best promotions and upcoming events. Plus get 25% off your next purchase. Newsletter Sign Up Download Accounts Your email address is your account identifier. You can create a password, or just download from the links sent via email. My Orders (Resend order emails) How We're Different Hands-on instructions Solutions to real-worl
Rails 5.2.0 FINAL: Active Storage, Redis Cache Store, HTTP/2 Early Hints, CSP, Credentials Nearly 14 years since the first public version of Rails, it’s our pleasure to release yet another major upgrade to the framework in the form of 5.2.0 final. We’ve been diligently polishing Active Storage and the other big new components for stable release, and it’s great to see so many applications already r
SmartHR のソフトウェアエンジニア ぷりんたい です。SmartHR には2017年2月に入社しました。 この記事は SmartHR 長時間のサービス停止を伴うシステムメンテナンスのお知らせ によせて書かれたものです。 ご挨拶 SmartHR では、昨年の6月より週2日という頻度で夜間のサービス停止を行ってきました。まずは、この運用形態を選択したことによりご利用中のお客様にはご不便をおかけしたことをお詫び申し上げます。 今日のクラウドサービスでは、無停止運用が当たり前といった風潮もありますが、なぜ SmartHR が停止メンテナンス運用を選択したのか、今後のサービス提供においてどのようなことを重視していくのかを技術者としての立場からご説明させて頂きます。 SmartHR の開発初期とマルチテナント問題 SmartHR は2015年2月に開発が始まり、同年11月にサービスインしました。
ども、@kimihom です。 私は Web フレームワークは Ruby on Rails を利用している。かれこれバージョン2.2 の頃から使い続けているので 7年以上になる。そこまでして私が Ruby on Rails を使い続ける魅力について個人的な想いを記していく。 Rails の作者 DHH と彼の環境 Rails の作者として有名な DHH(David Heinemeier Hansson) という名前は、 Ruby on Rails を触ったことがあるなら必ずや聞いたことがあるだろう。しかし、彼のいる会社 Basecamp がどんな想いでどんなことをしているかを知っている人は案外少ない。 Basecamp はプロジェクト管理の SaaS である。今や世界中に顧客を抱える超有名サービスであり、Basecamp は Ruby on Rails の最新版をプロダクトに反映され続けて
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く