Instead of conditionally define the attribute we should do the same we do with store attributes. https://github.com/rails/rails/blob/master/activerecord/lib/active_record/store.rb#L69