2019-07-13から1日間の記事一覧

新規・更新を条件分岐できるpersisted?のソースコードを読んでみた

環境やバージョン $rails -v Rails 5.2.3 $ruby -v ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin18] ソースコードリーディング Returns true if the record is persisted, i.e. it's not a new record and it was not destroyed, otherwise ret…