Quantcast
Channel: Active Recordの記事一覧|TechRacho by BPS株式会社
Browsing latest articles
Browse All 68 View Live

Image may be NSFW.
Clik here to view.

has_manyにブロック引数を渡してリレーションを拡張する

今日はhas_manyのブロック引数に関して取り上げます。 以下のモデルを想定します。 # attributes # # name: 氏名 # attendance_count: 出席回数 class Student < ApplicationRecord has_many :exams end # attributes # # student_id: 学生ID # subject: 教科 #...

View Article


Image may be NSFW.
Clik here to view.

Rails API: ActiveRecord::AutosaveAssociation(翻訳)

概要 MITライセンスに基づいて翻訳・公開いたします。 英語記事: Rails API ActiveRecord::AutosaveAssociation 原文更新日: 2021/07/30(7d9b5d4) ライセンス: MIT 訳文には適宜強調を加えています。 Rails API: ActiveRecord::AutosaveAssociation(翻訳)...

View Article


Image may be NSFW.
Clik here to view.

Rails: Active RecordでRepositoryパターンを実装する(翻訳)

概要 元サイトの許諾を得て翻訳・公開いたします。 英語記事: Repository implementation on ActiveRecord | Arkency Blog 原文公開日: 2023/12/28 原著者: Paweł Pacana Rails: Active RecordでRepositoryパターンを実装する(翻訳)...

View Article

Image may be NSFW.
Clik here to view.

Rails 7.2: ActiveRecord::Core#inspectの修正とattributes_for_inspectの便利な使い方(翻訳)

概要 CC BY-NC-SA 4.0 Deedに基づいて翻訳・公開いたします。 英語記事: Fixing a footgun in ActiveRecord::Core#inspect | Rails at Scale 原文公開日: 2024/04/30 原著者: Andrew Novoselac CC BY-NC-SA 4.0 Deed | 表示 - 非営利 - 継承 4.0 国際 |...

View Article

Image may be NSFW.
Clik here to view.

Rails 7.2: ActiveRecord::Base#pluckにハッシュ値を渡せるようになった(翻訳)

概要 元サイトの許諾を得て翻訳・公開いたします。 英語記事: ActiveRecord::Base#pluck adds support for hash values in Rails 7.2 | Saeloun Blog 原文公開日: 2024/04/26 原著者: Nishant Samel Rails 7.2:...

View Article


Image may be NSFW.
Clik here to view.

Rails 7.2: strict_loadingがn_plus_one_onlyモードで子の関連付けをeager loadingしないよう修正(翻訳)

概要 元サイトの許諾を得て翻訳・公開いたします。 英語記事: Strict Loading Using :n_plus_one_only Mode Does Not Eagerly Load Child Associations In Rails 7.2. | Saeloun Blog 原文公開日: 2024/05/21 原著者: Prasanth Chaduvula 参考: 4.1.2.14...

View Article

Image may be NSFW.
Clik here to view.

Rails 7.2.0 Active Record CHANGELOG(全項目リンク付き)

概要 MITライセンスに基づいて翻訳・公開いたします。 英語記事: rails/activerecord/CHANGELOG.md at 7-2-stable · rails/rails -- 7.2.0.beta2(2024/06/05) ライセンス: MIT Rails 7.2.0リリース後に必要であれば更新します。...

View Article

Image may be NSFW.
Clik here to view.

複雑なクエリーをActive Recordのモデルとして定義する方法

概要 以下の accounts と profiles というテーブルから、WITH句で users テーブルを作り、この users テーブルを Active Record のモデルとして利用できるようにします。 Railsのバージョンは7を用いましたが6でも動作すると思います。 accounts テーブル 列名 型 概要 id int PK email string ログインメールアドレス...

View Article


Image may be NSFW.
Clik here to view.

Rails 7.2: counter_cacheをactiveオプションでオンオフ可能になった(翻訳)

概要 元サイトの許諾を得て翻訳・公開いたします。 英語記事: Rails 7.2 makes counter_cache integration safer and easier - BigBinary Blog 原文公開日: 2024/07/16 原著者: Navaneeth D 日本語タイトルは内容に即したものにしました。 参考: 週刊Railsウォッチ20240416:...

View Article


Image may be NSFW.
Clik here to view.

Rails 7.2: SQLクエリ数がログに出力されるようになった(翻訳)

概要 元サイトの許諾を得て翻訳・公開いたします。 英語記事: Rails 7.2 brings SQL queries count to template rendering logs - BigBinary Blog 原文公開日: 2024/08/20 原著者: Navaneeth D 日本語タイトルは内容に即したものにしました。 Rails 7.2:...

View Article
Browsing latest articles
Browse All 68 View Live