Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ gem 'good_job', '~> 4.0'
gem 'rotp'

gem 'grpc', '~> 1.67'
gem 'tucana', '0.0.66'
gem 'tucana', '0.0.67'

gem 'code0-identities', '~> 0.0.3'

Expand All @@ -92,4 +92,4 @@ gem 'image_processing', '>= 1.2'

gem 'json-schema', '~> 6.0'

gem 'triangulum', '0.5.2'
gem 'triangulum', '0.10.0'
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,13 @@ GEM
test-prof (1.5.0)
thor (1.4.0)
timeout (0.6.0)
triangulum (0.5.2)
triangulum (0.10.0)
base64 (~> 0.3)
json (~> 2.19)
open3 (~> 0.2)
tucana (~> 0.0, >= 0.0.62)
tucana (~> 0.0, >= 0.0.67)
tsort (0.2.0)
tucana (0.0.66)
tucana (0.0.67)
grpc (~> 1.64)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -437,8 +437,8 @@ DEPENDENCIES
simplecov (~> 0.22.0)
simplecov-cobertura (~> 3.0)
test-prof (~> 1.0)
triangulum (= 0.5.2)
tucana (= 0.0.66)
triangulum (= 0.10.0)
tucana (= 0.0.67)
tzinfo-data

RUBY VERSION
Expand Down
22 changes: 20 additions & 2 deletions app/models/function_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,25 @@ class FunctionDefinition < ApplicationRecord
class_name: 'Translation', as: :owner, inverse_of: :owner
has_many :aliases, -> { by_purpose(:alias) }, class_name: 'Translation', as: :owner, inverse_of: :owner

delegate :to_grpc, to: :runtime_function_definition

scope :by_node_function, ->(node_functions) { where(node_functions: node_functions) }

def to_grpc
Tucana::Shared::FunctionDefinition.new(
runtime_name: runtime_function_definition.runtime_name,
parameter_definitions: parameter_definitions.map(&:to_grpc),
signature: runtime_function_definition.signature,
throws_error: runtime_function_definition.throws_error,
name: names.map(&:to_grpc),
description: descriptions.map(&:to_grpc),
documentation: documentations.map(&:to_grpc),
deprecation_message: deprecation_messages.map(&:to_grpc),
display_message: display_messages.map(&:to_grpc),
alias: aliases.map(&:to_grpc),
linked_data_type_identifiers: runtime_function_definition.referenced_data_types.map(&:identifier),
version: runtime_function_definition.version,
display_icon: runtime_function_definition.display_icon,
definition_source: runtime_function_definition.definition_source,
runtime_definition_name: runtime_function_definition.runtime_name
)
end
end