2019-01-01から1年間の記事一覧
dockerの中で作業します。 docker run -it debian:sid bash 環境 root@c12674db7ecf:/mysql-server/bld_debug# cat /etc/debian_version 10.0 root@c12674db7ecf:/mysql-server/bld_debug# gcc --version |grep gcc gcc (Debian 9.2.1-21) 9.2.1 20191130 si…
github.com rails6にするまでは動いていたんだけど、Transactionクラスのメソッド呼び出しで undefined method がでるようになったんだけど、 Transactionクラスを持つことはrails6からは許可されていませんか?というissueというか完全なる質問。 これにつ…
github.com etagに関するドキュメントで誤りがあって、それを修正プルリクエスト。 fresh_when etag: @article # correct fresh_when @article # incorrect 最終的にはマージされたものの、マージした人いわく、このドキュメントを変更したところであまり変…
github.com タイトルの通り、rails g migration AddColumnsToTable name user:references を実行すろと、null: falseオプションが追加される仕様に異議を唱えるissue。 この人が言っていることは2つあって null: falseつくけど、 belongs_toがオプショナルな…
github.com パーシャルをレンダリングする時ってeachで回すと、N+1クエリ状態ですごく遅いんだよね。そういう時はパーシャルのレンダリングオプションにcollectionをつけることで、 レンダリングのオーバーヘッドを抑えることができる。 render 'books', as:…
github.com 半角スペースを含む€のような通貨だと意図しない改行が発生してしまう、という文脈みたい。 ちなみに、CSSにはスペースなどの単語の区切りで改行するようになっている。 今までは半角スペースを置換するパッチが活躍していたらしい。 HTMLEntitie…
github.com link_to の第2引数に javascript:...を渡すとそのまま発火するよ。というissue。 本文には対策のdiffも添えられている。 dofer to~ 〜に従う familiar with ~に精通
ActiveRecord valid? should includes ActiveModel validation for integer type column · Issue #37256 · rails/rails · GitHub validationを設定していないモデルのテーブルにint(11)型で定義したカラムにint(11)を超える値を設定すると、バリデーションエ…
Migration running twice #37225 Migration running twice · Issue #37225 · rails/rails · GitHub 質問1 railsコマンドを実行すると2回実行してしまう。一体何が起きているんですか? (本文に再現コードあり) 回答1 This file does not have the migration …
github.com render :text が削除されたことがアップグレード移行ガイドにに書かれていない、という指摘のissueだ。 本文 render :text was removed in 5.1 but it is not mentioned in the upgrading guide for 5.1. render :textが5.1から削除されたが、ア…
github.com 本文 rails4.2.xでは、 lib/active_record/core.rb#initialize_dup が正しく複製してくれるけれども、rails5.2ではpullするだけ MyModel._default_attributes によって、すでに複製したものを削除する。 Yes this still occurs on 5-2-stable. I'…
github.com String inflection method underscore giving wrong output #37163 質問 アンダースコアライズする文字列変換文字列のアウトプットがおかしいんだが? Open up rails console and type - "ActLikeStar".underscore gives you 'act_like_star' whi…
Why do it need to execute SQL when ActiveRecord query conditions is empty array? · Issue #35307 · rails/rails · GitHub User.where(id: []) というコードを実行すると SELECT COUNT(*) FROM users WHERE 1=0という空を返却するSQLを発行している。必…