Class: Kidspire::SyncSetting
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Kidspire::SyncSetting
- Defined in:
- app/models/kidspire/sync_setting.rb
Constant Summary collapse
- CONFLICT_STRATEGIES =
%w[pco_wins kidspire_wins newest_wins].freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#effective_ministry_tag ⇒ Object
Reads tag from DB; falls back to the env var so existing deployments continue working before the settings page is used for the first time.
Class Method Details
.current ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/models/kidspire/sync_setting.rb', line 8 def self.current first_or_create!( inbound_people_sync: true, outbound_people_sync: false, inbound_events_sync: true, outbound_registrations_sync: false, sync_frequency_hours: 6, conflict_resolution: "pco_wins", auto_sync_enabled: false, pco_kids_ministry_tag: nil ) end |
Instance Method Details
#effective_ministry_tag ⇒ Object
Reads tag from DB; falls back to the env var so existing deployments continue working before the settings page is used for the first time.
23 24 25 26 |
# File 'app/models/kidspire/sync_setting.rb', line 23 def effective_ministry_tag pco_kids_ministry_tag.presence || Kidspire.configuration.pco_kids_ministry_tag.presence end |