Class: Outpost::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/outpost/config.rb

Constant Summary collapse

DEFAULTS =
{
  :title_attributes           => [:name, :title],
  :excluded_form_fields       => ["id", "created_at", "updated_at"],
  :excluded_list_columns      => [],
  :user_class                 => "User",
  :authentication_attribute   => :email,
  :preferences                => [:order_attribute, :order_direction]
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#authentication_attributeObject



41
42
43
# File 'lib/outpost/config.rb', line 41

def authentication_attribute
  @authentication_attribute || DEFAULTS[:authentication_attribute]
end

#excluded_form_fieldsObject



53
54
55
# File 'lib/outpost/config.rb', line 53

def excluded_form_fields
  (@excluded_form_fields ||= []) | DEFAULTS[:excluded_form_fields]
end

#excluded_list_columnsObject



59
60
61
# File 'lib/outpost/config.rb', line 59

def excluded_list_columns
  (@excluded_list_columns ||= []) | DEFAULTS[:excluded_list_columns]
end

#preferencesObject



30
31
32
# File 'lib/outpost/config.rb', line 30

def preferences
  @preferences || DEFAULTS[:preferences]
end

#registered_modelsObject



25
26
27
# File 'lib/outpost/config.rb', line 25

def registered_models
  @registered_models || []
end

#title_attributesObject



47
48
49
# File 'lib/outpost/config.rb', line 47

def title_attributes
  (@title_attributes ||= DEFAULTS[:title_attributes]) | [:simple_title]
end

#user_classObject



35
36
37
# File 'lib/outpost/config.rb', line 35

def user_class
  @user_class || DEFAULTS[:user_class]
end

Class Method Details

.configure {|Outpost.config| ... } ⇒ Object

Pass a block to this method to define the configuration If no block is passed, config will be defaults

Yields:



18
19
20
21
# File 'lib/outpost/config.rb', line 18

def self.configure
  yield Outpost.config if block_given?
  Outpost.config
end