-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #492 from senid231/active-calls-api-patch-1.8
Active calls API patch 1.8
- Loading branch information
Showing
34 changed files
with
1,319 additions
and
640 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
class Api::Rest::Admin::ActiveCallsController < Api::Rest::Admin::BaseController | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
class ActiveCallDecorator < ApplicationDecorator | ||
def self.object_class_namespace | ||
'RealtimeData' | ||
end | ||
|
||
RealtimeData::ActiveCall.association_types.each do |name, foreign_key:, **_| | ||
define_method("#{name}_link") do | ||
record = model.public_send(name) | ||
record ? h.auto_link(record) : model.public_send(foreign_key) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
class ApplicationDecorator < Draper::Decorator | ||
include Rails.application.routes.url_helpers | ||
delegate_all | ||
|
||
def self.object_class_name | ||
return nil if name.nil? || name.demodulize !~ /.+Decorator$/ | ||
|
||
class_name = name.chomp('Decorator') | ||
namespace = object_class_namespace | ||
namespace.blank? ? class_name : "#{namespace}::#{class_name}" | ||
end | ||
|
||
def self.object_class_namespace | ||
nil | ||
end | ||
end |
Oops, something went wrong.