How would I go about setting a default value to reference an existing column's value?
For example, I have a setting such as 'notification_email', where the default value should be the current value of the email column.
typed_store :settings, coder: DumbCoder do |s| s.string :notification_email, default: self.email, null: false end
I've tried self.email, email and a few other variants but I either get errors referencing to call connection on the related model, or that it email is an undefined method.
How would I go about setting a default value to reference an existing column's value?
For example, I have a setting such as 'notification_email', where the default value should be the current value of the email column.
typed_store :settings, coder: DumbCoder do |s| s.string :notification_email, default: self.email, null: false end
I've tried self.email, email and a few other variants but I either get errors referencing to call connection on the related model, or that it email is an undefined method.