dogwood008の開発メモ!

最近のマイブームは機械学習, Ruby on Rails。中でも機械学習を使った金融商品の自動取引に興味があります。

2022-08-03から1日間の記事一覧

【Rails】ActiveSupport::Concernを使うと、お手軽にクラスメソッドとscopeやhas_many等の定義ができる

要旨 module M extend ActiveSupport::Concern included do scope :disabled, -> { where(disabled: true) } end class_methods do ... end end https://github.com/rails/rails/blob/main/activesupport/lib/active_support/concern.rb より 詳細 included …