class Administrate::Field::Associative

Public Instance Methods

associated_class() click to toggle source
# File lib/administrate/field/associative.rb, line 10
def associated_class
  associated_class_name.constantize
end
display_associated_resource() click to toggle source
# File lib/administrate/field/associative.rb, line 6
def display_associated_resource
  associated_dashboard.display_resource(data)
end

Protected Instance Methods

associated_class_name() click to toggle source
# File lib/administrate/field/associative.rb, line 20
def associated_class_name
  options.fetch(:class_name, attribute.to_s.singularize.camelcase)
end
associated_dashboard() click to toggle source
# File lib/administrate/field/associative.rb, line 16
def associated_dashboard
  "#{associated_class_name}Dashboard".constantize.new
end
foreign_key() click to toggle source
# File lib/administrate/field/associative.rb, line 28
def foreign_key
  options.fetch(:foreign_key, :"#{attribute}_id")
end
primary_key() click to toggle source
# File lib/administrate/field/associative.rb, line 24
def primary_key
  options.fetch(:primary_key, :id)
end