Sha256: ecd6536b2e650cc246ddf25f3ffc7d724a3cc27baf97f45b4adb8ff4c950f13a
Contents?: true
Size: 685 Bytes
Versions: 12
Compression:
Stored size: 685 Bytes
Contents
require_relative "base" module Administrate module Field class Associative < Base def display_associated_resource associated_dashboard.display_resource(data) end def associated_class associated_class_name.constantize end protected def associated_dashboard "#{associated_class_name}Dashboard".constantize.new end def associated_class_name options.fetch(:class_name, attribute.to_s.singularize.camelcase) end def primary_key options.fetch(:primary_key, :id) end def foreign_key options.fetch(:foreign_key, :"#{attribute}_id") end end end end
Version data entries
12 entries across 12 versions & 3 rubygems