mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-28 09:24:24 +01:00
(bug) meta_data does not exists
Also: improved writing auth provider config to file
This commit is contained in:
parent
0c3780a3f6
commit
1f618d29f7
@ -45,7 +45,7 @@ class AuthProvider < ApplicationRecord
|
||||
provider = find_by(status: 'active')
|
||||
return local if provider.nil?
|
||||
|
||||
provider
|
||||
provider.reload
|
||||
rescue ActiveRecord::StatementInvalid
|
||||
# we fall here on database creation because the table "active_providers" still does not exists at the moment
|
||||
local
|
||||
|
@ -3,7 +3,7 @@
|
||||
# send notification to one or several receiver with a type, an attached object and an optional meta data
|
||||
class NotificationCenter
|
||||
class << self
|
||||
def call(type: nil, receiver: nil, attached_object: nil)
|
||||
def call(type: nil, receiver: nil, attached_object: nil, meta_data: {})
|
||||
return if prevent_notify?(type: type, attached_object: attached_object)
|
||||
|
||||
receiver = [receiver] unless receiver.respond_to?(:each)
|
||||
|
@ -49,6 +49,7 @@ class ProviderConfig
|
||||
)
|
||||
file_path = Rails.root.join('config/auth_provider.yml')
|
||||
File.open(file_path, File::WRONLY | File::CREAT) do |file|
|
||||
file.truncate(0)
|
||||
file.write(JSON.parse(data).to_yaml)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user