Applied rubocop.
This commit is contained in:
parent
58de72cfc1
commit
3ea2a1aa2e
1 changed files with 11 additions and 11 deletions
|
@ -2,17 +2,17 @@ class Sessions::Event
|
||||||
include ApplicationLib
|
include ApplicationLib
|
||||||
|
|
||||||
def self.run(event, data, session, client_id)
|
def self.run(event, data, session, client_id)
|
||||||
adapter = "Sessions::Event::#{event.to_classname}"
|
adapter = "Sessions::Event::#{event.to_classname}"
|
||||||
begin
|
begin
|
||||||
backend = load_adapter(adapter)
|
backend = load_adapter(adapter)
|
||||||
rescue => e
|
rescue => e
|
||||||
return { error: "No such event #{event}" }
|
return { error: "No such event #{event}" }
|
||||||
end
|
end
|
||||||
|
|
||||||
ActiveRecord::Base.establish_connection
|
ActiveRecord::Base.establish_connection
|
||||||
result = backend.run(data, session, client_id)
|
result = backend.run(data, session, client_id)
|
||||||
ActiveRecord::Base.remove_connection
|
ActiveRecord::Base.remove_connection
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue