Class: Sunrise::Config::Index

Inherits:
Base
  • Object
show all
Includes:
HasFields, HasGroups
Defined in:
lib/sunrise/config/index.rb

Instance Attribute Summary

Attributes inherited from Base

#abstract_model, #name, #parent

Instance Method Summary collapse

Methods included from HasGroups

#group, #groups, #visible_groups

Methods included from HasFields

#field, #fields, #nested_attributes

Methods inherited from Base

#initialize, register_class_option, #register_instance_option, register_instance_option

Constructor Details

This class inherits a constructor from Sunrise::Config::Base

Instance Method Details

#preview_for(record) ⇒ Object



41
42
43
44
45
46
47
# File 'lib/sunrise/config/index.rb', line 41

def preview_for(record)
  if preview.respond_to?(:call)
    preview.call(record) || "sunrise/default_ava.png"
  else
    preview
  end
end