-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
I'm looking to use multiple jsonb columns on the same model. However, it is possible some of those columns will share the same keys, which can lead to problems when using accessors.
Is it currently possible to create namespaces for accessors? For example, something like:
class NotificationSettings < ApplicationRecord
typed_store :email do |s|
namespace :email
s.boolean :enabled, default: false, null: false
....
end
typed_store :push do |s|
namespace :push
s.boolean :enabled, default: false, null: false
....
end
typed_store :sms do |s|
namespace :sms
s.boolean :enabled, default: false, null: false
....
end
end
So that I could access each enabled setting with an accessor? Like NoficiationSettings.email.enabled?.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels