Class: Outpost::Config
- Inherits:
-
Object
- Object
- Outpost::Config
- 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
- #authentication_attribute ⇒ Object
- #excluded_form_fields ⇒ Object
- #excluded_list_columns ⇒ Object
- #preferences ⇒ Object
- #registered_models ⇒ Object
- #title_attributes ⇒ Object
- #user_class ⇒ Object
Class Method Summary collapse
-
.configure {|Outpost.config| ... } ⇒ Object
Pass a block to this method to define the configuration If no block is passed, config will be defaults.
Instance Attribute Details
#authentication_attribute ⇒ Object
41 42 43 |
# File 'lib/outpost/config.rb', line 41 def authentication_attribute @authentication_attribute || DEFAULTS[:authentication_attribute] end |
#excluded_form_fields ⇒ Object
53 54 55 |
# File 'lib/outpost/config.rb', line 53 def excluded_form_fields (@excluded_form_fields ||= []) | DEFAULTS[:excluded_form_fields] end |
#excluded_list_columns ⇒ Object
59 60 61 |
# File 'lib/outpost/config.rb', line 59 def excluded_list_columns (@excluded_list_columns ||= []) | DEFAULTS[:excluded_list_columns] end |
#preferences ⇒ Object
30 31 32 |
# File 'lib/outpost/config.rb', line 30 def preferences @preferences || DEFAULTS[:preferences] end |
#registered_models ⇒ Object
25 26 27 |
# File 'lib/outpost/config.rb', line 25 def registered_models @registered_models || [] end |
#title_attributes ⇒ Object
47 48 49 |
# File 'lib/outpost/config.rb', line 47 def title_attributes (@title_attributes ||= DEFAULTS[:title_attributes]) | [:simple_title] end |
#user_class ⇒ Object
35 36 37 |
# File 'lib/outpost/config.rb', line 35 def user_class @user_class || DEFAULTS[:user_class] end |