mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-26 20:54:21 +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')
|
provider = find_by(status: 'active')
|
||||||
return local if provider.nil?
|
return local if provider.nil?
|
||||||
|
|
||||||
provider
|
provider.reload
|
||||||
rescue ActiveRecord::StatementInvalid
|
rescue ActiveRecord::StatementInvalid
|
||||||
# we fall here on database creation because the table "active_providers" still does not exists at the moment
|
# we fall here on database creation because the table "active_providers" still does not exists at the moment
|
||||||
local
|
local
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# send notification to one or several receiver with a type, an attached object and an optional meta data
|
# send notification to one or several receiver with a type, an attached object and an optional meta data
|
||||||
class NotificationCenter
|
class NotificationCenter
|
||||||
class << self
|
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)
|
return if prevent_notify?(type: type, attached_object: attached_object)
|
||||||
|
|
||||||
receiver = [receiver] unless receiver.respond_to?(:each)
|
receiver = [receiver] unless receiver.respond_to?(:each)
|
||||||
|
@ -49,6 +49,7 @@ class ProviderConfig
|
|||||||
)
|
)
|
||||||
file_path = Rails.root.join('config/auth_provider.yml')
|
file_path = Rails.root.join('config/auth_provider.yml')
|
||||||
File.open(file_path, File::WRONLY | File::CREAT) do |file|
|
File.open(file_path, File::WRONLY | File::CREAT) do |file|
|
||||||
|
file.truncate(0)
|
||||||
file.write(JSON.parse(data).to_yaml)
|
file.write(JSON.parse(data).to_yaml)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user