Module: SyncAttrWithAuth0::Adapters::ActiveRecord::ClassMethods
- Defined in:
- lib/sync_attr_with_auth0/adapters/active_record.rb
Instance Method Summary collapse
-
#sync_attr_with_auth0(*fields) ⇒ Object
TODO: We should accept two arrays of fields: user_metadata (for user-managed settings) and app_metadata (for app-managed settings).
Instance Method Details
#sync_attr_with_auth0(*fields) ⇒ Object
TODO: We should accept two arrays of fields: user_metadata (for user-managed settings) and app_metadata (for app-managed settings)
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/sync_attr_with_auth0/adapters/active_record.rb', line 17 def sync_attr_with_auth0(*fields) = fields. # Setup methods for accessing fields and options define_method 'auth0_attributes_to_sync' do fields end define_method 'setup_auth0_sync_configuration' do config = SyncAttrWithAuth0.configuration.dup .each do |key, value| config.send(:"#{key}=", value) end config end # Setup callbacks after_validation :validate_email_with_auth0 after_create :save_to_auth0_after_create after_update :save_to_auth0_after_update end |