Ruby on Rails

メモ: delayed_job

delayed_jobで実行出来るタスクはActiveRecordのモデルでDBに保存済みのもののみ 保存されていないもので実行すると失敗するNG Hoge.new.delay.piyopiyo OK Hoge.create!.delay.piyopiyo 追記: クラスメソッドの場合は何でも行けるみたい Hoge.delay.fuga と…

メモ: ActiveRecord

ActiveRecordのloggerはモデルを定義する前に設定しないと有効にならない。NG ActiveRecord::Base.configurations = YAML.load_file(config_file) ActiveRecord::Base.establish_connection class User < ActiveRecord::Base end # 中略 ActiveRecord::Base.…