Module: SpreeCmCommissioner::OauthApplicationDecorator

Defined in:
app/models/spree_cm_commissioner/oauth_application_decorator.rb

Class Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/models/spree_cm_commissioner/oauth_application_decorator.rb', line 3

def self.prepended(base)
  base.belongs_to :tenant, class_name: 'SpreeCmCommissioner::Tenant'

  # treat a key inside a JSONB column like a normal Rails attribute,
  # with getter/setter methods
  begin
    base.store_accessor :settings, :sms_sender_id
  rescue StandardError
    # Fallback when :settings column is missing or not a JSON store in the current DB (e.g., spec schema)
    # Provides a non-persisted accessor so tests can still set/read sms_sender_id
    base.attr_accessor :sms_sender_id
  end
end