Sha256: a856d4aefad18eb65e45154bc76813e2c20e06be3eb71567094cdd3620396924
Contents?: true
Size: 983 Bytes
Versions: 44
Compression:
Stored size: 983 Bytes
Contents
# frozen_string_literal: true class Avo::BaseComponent < ViewComponent::Base def has_with_trial(ability) ::Avo::App.license.has_with_trial(ability) end private # Figure out what is the corresponding field for this @reflection def field fields = ::Avo::App.get_resource_by_model_name(@reflection.active_record.name).get_field_definitions fields.find { |f| f.id == @reflection.name } rescue nil end def relation_resource ::Avo::App.get_resource_by_model_name params[:via_resource_class].safe_constantize end # Get the resource for the resource using the klass attribute so we get the namespace too def reflection_resource ::Avo::App.get_resource_by_model_name(@reflection.klass.to_s) rescue nil end # Get the resource for the resource using the klass attribute so we get the namespace too def reflection_parent_resource ::Avo::App.get_resource_by_model_name(@reflection.active_record.to_s) rescue nil end end
Version data entries
44 entries across 44 versions & 1 rubygems