Entries from 2015-02-15 to 1 day
TL;DR allow_nilでNoMethodError対策 prefixでメソッド名に接頭辞をつける delegateの便利オプション allow_nil class User include ActiveMode::Model attr_accesor :profile delegate :name, to: :profile, allow_nil: true end class Profile attr_access…
TL;DR allow_nilでNoMethodError対策 prefixでメソッド名に接頭辞をつける delegateの便利オプション allow_nil class User include ActiveMode::Model attr_accesor :profile delegate :name, to: :profile, allow_nil: true end class Profile attr_access…