プロダクト開発日誌

技術のことなど

2019-04-04から1日間の記事一覧

Git hooksの導入

github.com git hooksはコミットやマージの前にスクリプトを走らす機能 Hooksの運用に便利なgem overcommitをインストールする group :development do # A fully configurable and extendable Git hook manager # Read more: https://github.com/brigade/ove…

bundler の バージョンを指定する

bundler.io Install可能なバージョンを指定 gem search ^bundler$ --all バージョンを指定してインストール gem install bundler -v 2.0.1 インストール済みのバージョン gem list bundler バージョンを指定して実行 bundle _2.0.1_ install

Rails app に Rubocopを導入する

github.com Gemfile group :development do # A Ruby static code analyzer and formatter, based on the community Ruby style guide. https://docs.rubocop.org gem 'rubocop', require: false end bundle install touch .rubocop.yml AllCops: Rails: tru…

annotateでschemeをmodelに書き出す

github.com Gemfile group :development do gem 'annotate' end bundle install 使い方 bundle exec annotate テーブルの情報がコメントで記載されます # == Schema Information # # Table name: areas # # id :bigint(8) not null, primary key # name :str…

【Rails】モデルに都道府県情報を持たせる

今回はacrive__hashを利用して、Area Model に都道府県情報を付与します。 github.com install # A readonly ActiveRecord-esque base class that lets you use a hash, a Yaml file or a custom file as the datasource. Read more: https://github.com/zil…