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 =
[:admin_name, :admin_title, :name, :title]
- @@plugins =
Para::Plugins::Set.new
- @@ability_class_name =
'Para::Ability'
- @@page_actions =
{}
- @@database_cache_store_max_items =
10000
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
86 87 88 89 90 |
# File 'lib/para/config.rb', line 86 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
50 51 52 |
# File 'lib/para/config.rb', line 50 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
42 43 44 45 |
# File 'lib/para/config.rb', line 42 def self.jobs_store=(store) @@jobs_store = store ActiveJob::Status.store = store end |
.method_missing(method_name, *args, &block) ⇒ Object
69 70 71 72 73 74 75 76 |
# File 'lib/para/config.rb', line 69 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
82 83 84 |
# File 'lib/para/config.rb', line 82 def self.page_actions_for(type) page_actions[type] ||= [] end |
.plugins=(array) ⇒ Object
24 25 26 27 |
# File 'lib/para/config.rb', line 24 def self.plugins=(array) # Add each item in array to the existing plugins set array.each(&plugins.method(:<<)) end |