2016-10-01から1ヶ月間の記事一覧

Rails5 では、production 時、config.autoload_paths が機能しない

こちらに変更点が書かれていますが、A Guide for Upgrading Ruby on Rails — Ruby on Rails Guides Autoloadを有効にする $ vi config/environments/production.rb config.enable_dependency_loading = true 起動時にロードする config.eager_load_paths += …

Twitter Card の申請が通った場合、同一ドメインすべてでTwitterカードが有効になる

https://appspot.info/share/11111の審査が通った場合、ドメイン単位で承認されるため、ほかのパスも有効になります。https://appspot.info/hoge/2222

Rails5 ActiveRecord で select をする時の高速化便利関数

select 高速化のヒント class Parent has_many :childs end class Child belongs_to :parent end has_many の配列データ側を絞り込む。なければ parent も返らない。 Parent.includes(:childs).where("childs.age > ?", 20).references(:childs) belongs_to …

AWS Elastic Beanstalk x Ruby on Rails で構築する

セットアップする環境 Ruby on Rails5 RDS (Mysql) Puma CloudFront を用いて起動させる。アプリケーション名は {app name} とする。 手順 RDS を起動 eb コマンドで、同時にRDS を起動させることも可能だが、アプリケーションの削除と同時に、RDSも消えてし…