Class: Ruolo::Sync
- Inherits:
-
Object
- Object
- Ruolo::Sync
- Defined in:
- lib/ruolo/sync.rb
Overview
This class manages the actual synchronization of the policy file with the database.
Instance Method Summary collapse
-
#initialize(policy_file) ⇒ Ruolo::Sync
constructor
Create a new synchronization ojbect.
-
#sync! ⇒ void
Bring the configured database in sync with the policy file, adding and removing roles, permissions, and the permissions that belong to roles as necessary.
Constructor Details
#initialize(policy_file) ⇒ Ruolo::Sync
Create a new synchronization ojbect.
30 31 32 |
# File 'lib/ruolo/sync.rb', line 30 def initialize(policy_file) @policy_document = YAML.safe_load(File.read(policy_file), symbolize_names: true) end |
Instance Method Details
#sync! ⇒ void
This method returns an undefined value.
Bring the configured database in sync with the policy file, adding and removing roles, permissions, and the permissions that belong to roles as necessary.
39 40 41 42 43 44 45 |
# File 'lib/ruolo/sync.rb', line 39 def sync! Ruolo.configuration.connection.transaction do roles_diff end end |