Module: Para::Config
- Defined in:
- lib/para/config.rb
Constant Summary collapse
- @@authenticate_admin_method =
:authenticate_admin_user!- @@current_admin_method =
:current_admin_user- @@pagination_theme =
'twitter-bootstrap-3'- @@admin_title =
nil- @@default_tree_max_depth =
3- @@resource_name_methods =
i[admin_name admin_title name title]
true- @@para_components_directory =
'components'- @@plugins =
Para::Plugins::Set.new
- @@ability_class_name =
'Para::Ability'- @@page_actions =
{}
- @@dark_theme =
false- @@uncollapse_inset_nested_fields =
true- @@load_file_inputs =
true- @@database_cache_store_max_items =
10_000
Class Method Summary collapse
- .add_actions_for(*types, &block) ⇒ Object
-
.jobs_store ⇒ Object
Default to use Para::Cache::DatabaseStore, allowing cross process and app instances job status sharing.
-
.jobs_store=(store) ⇒ Object
Allows changing default cache store used by Para to store jobs through the ActiveJob::Status gem.
-
.method_missing(method_name, *args, &block) ⇒ Object
Allows accessing plugins root module to configure them through a method from the Para::Config class.
- .page_actions_for(type) ⇒ Object
- .plugins=(array) ⇒ Object
- .routes ⇒ Object
Class Method Details
.add_actions_for(*types, &block) ⇒ Object
105 106 107 108 109 |
# File 'lib/para/config.rb', line 105 def self.add_actions_for(*types, &block) types.each do |type| page_actions_for(type) << block end end |
.jobs_store ⇒ Object
Default to use Para::Cache::DatabaseStore, allowing cross process and app instances job status sharing
69 70 71 |
# File 'lib/para/config.rb', line 69 def self.jobs_store @@jobs_store ||= Para::Cache::DatabaseStore.new end |
.jobs_store=(store) ⇒ Object
Allows changing default cache store used by Para to store jobs through the ActiveJob::Status gem
61 62 63 64 |
# File 'lib/para/config.rb', line 61 def self.jobs_store=(store) @@jobs_store = store ActiveJob::Status.store = store end |
.method_missing(method_name, *args, &block) ⇒ Object
Allows accessing plugins root module to configure them through a method from the Para::Config class.
Example :
Para.config do |config|
config.my_plugin.my_var = 'foo'
end
88 89 90 91 92 93 94 95 |
# File 'lib/para/config.rb', line 88 def self.method_missing(method_name, *args, &block) if plugins.include?(method_name) plugin = Para::Plugins.module_name_for(method_name).constantize block ? block.call(plugin) : plugin else super end end |
.page_actions_for(type) ⇒ Object
101 102 103 |
# File 'lib/para/config.rb', line 101 def self.page_actions_for(type) page_actions[type] ||= [] end |
.plugins=(array) ⇒ Object
31 32 33 34 |
# File 'lib/para/config.rb', line 31 def self.plugins=(array) # Add each item in array to the existing plugins set array.each(&plugins.method(:<<)) end |
.routes ⇒ Object
97 98 99 |
# File 'lib/para/config.rb', line 97 def self.routes Para::Routes end |