Made a gem out of an earlier proof-of-concept: https://github.com/henrik/activemodel-with_conditions

This lets you do things like

``` ruby
with_conditions(if: :feature_x_is_on?) do
validate :free_plans_must_have_x, if: :free_plan?
end
```

where the conditions merge intuitively, unlike `with_options`.

#RubyOnRails #ActiveRecord #ActiveModel

FormObjectを編集に対応させる - Qiita

PF作成においてFormObjectを使用した際に、編集機能の実装に苦戦し時間を要したため覚え書きとして投稿させていただきます。form_withにおける登録、更新の切り替えform_with …

Qiita
Mince, #Simple_Form ne supporte pas #ActiveModel 5.1. Je viens de faire la mise à jour #Rails en 5.1 sur un projet. Du coup #Simple_Form retourne dans une version de 2011 😭