Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?

この記事は Speee Advent Calendar 2017 6日目の記事です。 5日目は @hatappi による Red Chainerをコードを変更せずに約2倍くらい早く処理させる でした。 数ヶ月前に、弊社の福利厚生制度でもある Speee Library のシステム全面リニューアルが行われ、アプリケーションが Rails 5.1 でリライトされました。 今回は、その運用の中で学んだ、 Rails 5.1 の Encrypted secrets と config gem を併用するためのコツを書き留めておきたいと思います。 config gem (rails_config) YAML (config/settings.yml) でアプリケーション設定を一元管理できる、定数管理 gem です。 環境別の設定 (config/settings/{environment}.yml)
Few days ago I’ve received email where I was asked for an advice from a web developer who was considering switching from Ruby to something else. I was asked in the email: If you would start from scratch, what would you choose: Ruby, Elixir or maybe even JS for the backend? Another important part of the email was that he was mainly interested in writing own side projects where main consideration is
次記事: Railsは2018年も現役か?: 中編(翻訳) 概要 原著者の許諾を得て翻訳・公開いたします。 英語記事: Is Rails still relevant in 2018 ? 原文公開日: 2018/08/16 著者: equivalent 記事は3分割しました。画像は元記事からの引用です。 Railsは2018年も現役か?(翻訳) Rubyから別の何かに乗り換えることを検討中のWeb開発者から、数日前にこんなメールを受け取りました。 まったく新規から始めるとしたら、バックエンドにRubyかElixirかJSのどれを選ぶ? このメールで他に重要と思われる部分は、現在の彼はもっぱら自分のサイドプロジェクトに関心を寄せていることと、主な懸念点は開発速度と開発のしやすさであるということです。 メールに返信を書き始めたのですが随分と長くなってしまったので、この際記事にすることにしました
RailsでWebサイトを作ってるんだけどフォームのバリデーション時にレイアウトが崩れて困った。 原因はform_forが勝手に出力する<div class="field_with_errors"></div>ってことがわかったので対応方法をメモ。 環境 Rails 4.2.2 事の発端 こんな感じのページがあって、 そのまま送信すると当然バリデーションエラーが起こる。 バリデーション引っかかるのは当然なんだけどなぜかレイアウトが崩れた。 原因 前後のHTMLを見比べてみると。 崩れる前 (一部抜粋) <section> <div class='row'> <label class="label col col-4" for="user_ユーザー名">ユーザー名</label> <div class='col col-8'> <label class='input'> <i class="
こんにちは、技術部開発基盤グループの id:hogelog です。 RubyKaigi 2018 楽しかったですね。僕はおそらく RubyKaigi 2010 以来の久しぶりの参加でした。ああいう場の楽しさを思い出し、また今回はスポンサーブースから RubyKaigi に参加するという学生の頃は知らなかった楽しみも新たに知り、RubyKaigi を満喫させていただきました。 さて今回はそんな RubyKaigi で取り戻した Ruby に対する感情と関係あるようなないような、最近自分が取り組んでいるお台場プロジェクトとプロジェクト内で実施している計測と可視化について紹介します。 お台場プロジェクトの発足 クックパッドの開発といえば数年前までは cookpad_all という一つのリポジトリの中に詰め込まれた巨大なモノリシック Rails アプリケーションを社内のエンジニアが寄ってたかって開
ユーザーエンゲージメント部の諸橋 id:moro です。 わたしはずっと、ユーザー登録やログイン周りという、サービス的には基盤的なところ、技術スタック的にはアプリケーション寄りのところに取り組んできました。関連する話を何度かこの開発者ブログにも書いています。 ユーザー基盤を作り直しながらRailsでのサービス層に向き合う 巨大なWEBアプリケーションに巨大な変更を取り入れるためにやったこと この記事で触れている「電話番号による登録」について、チームメンバーが別の側面を紹介してくれています。 今日はそのあたりの開発を通じて考えた、Railsアプリケーションでのフォームオブジェクトやサービス層といったものが何であるか、という問いに対する、現在の自分のスタンスを紹介します。 サービス層、サービスオブジェクト、フォームオブジェクト もともと Railsは Web 画面から DB 構造までをあえて密
Rails 5.1 introduced encrypted secrets, which gives you two places to put your secrets — secrets.yml and secrets.yml.enc. This causes a bit of confusion on when you should use normal secrets or encrypted secrets. Rails 5.2 replaces both secrets with encrypted credentials. You cannot use plain text credentials. There’s only credentials.yml.enc. Encrypted Credentials To use encrypted credentials, yo
5.1についてやった時に一回で詰め込みすぎたな、と反省したので、今回は二回に分けてやった(一回目がmajor featureで、二回目が各コンポーネント)。割と良かったんじゃないかと個人的には思っているので、多分次もそうすると思う。
Attempts to create a record with the given attributes in a table that has a unique constraint on one or several of its columns. If a row already exists with one or several of these unique constraints, the exception such an insertion would normally raise is caught, and the existing record with those attributes is sought found using #find_by. This is similar to #find_or_create_by, but avoids the pro
require 'date' class AddBirthdayDateToUsers < ActiveRecord::Migration[5.1] def up add_column :users, :birthday_date, :date User.reset_column_information User.find_each do |u| birthday_date = Date.new(u.year, u.month, u.day) rescue nil u.update(birthday_date: birthday_date || User::UNKNOWN_BIRTHDAY) end change_column_null :users, :birthday_date, false end end 上記のようにマイグレーション実行時にアプリケーションで定義したActiveRe
ここ1年で、Trailblazerの認知度は急速に上がってますよね。 BestGemsで見てみるとここ1年でめっちゃ伸びてます。 1月時点で6万4千DLだったのが、9月現在で既に15万を突破しているので、今年だけで倍以上のダウンロードですね…! 今回はそんな要チェックなGem、Trailblazerについて簡単に見ていきたいと思います。 Trailblazerとは Trailblazerは、RailsやSinatraなどで綺麗にビジネスロジックを書くためのGemです。 ModelやControllerが肥大化してカオスになっているアプリケーションに秩序をもたらしてくれます。 …なのですが、「具体的に何をするGemなの???」ってことですよね。 Trailblazerは複数のGemから構成されています。今回は代表的なGemである Operation 、 Reform 、 Cells、 Rep
by Shishir Kakaraddi, Srinivas Raghunathan, Adam Gross and Ryan Johnston We are pleased to announce the open source release of the Fast JSON API gem geared towards Ruby on Rails applications. Introduction Fast JSONAPI is aimed at providing all the major functionality that Active Model Serializer (AMS) provides, along with an emphasis on speed and performance by meeting a benchmark requirement of b
If you use Ruby and write automated tests you’re probably familiar with Database Cleaner. It’s a gem for cleaning your database in between each test. What you might not know is that if you use Rails, using Database Cleaner is entirely unnecessary because of transactional fixtures. Transactional fixtures are a great, but not particularly well-known feature of Rails. They are turned on by default an
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く