lib/para/config.rb in para-0.6.3 vs lib/para/config.rb in para-0.6.7
- old
+ new
@@ -16,21 +16,47 @@
@@default_tree_max_depth = 3
mattr_accessor :resource_name_methods
@@resource_name_methods = [:admin_name, :admin_title, :name, :title]
- mattr_accessor :plugins
- @@plugins = []
+ mattr_reader :plugins
+ @@plugins = Para::Plugins::Set.new
+ def self.plugins=(array)
+ # Add each item in array to the existing plugins set
+ array.each(&plugins.method(:<<))
+ end
+
# Hidden from initializer on purpose.
#
# This is mainly here to be overriden from a gem, not the app dev
#
mattr_accessor :ability_class_name
@@ability_class_name = 'Para::Ability'
mattr_accessor :page_actions
@@page_actions = {}
+
+ # Allows changing default cache store used by Para to store jobs through
+ # the ActiveJob::Status gem
+ #
+ def self.jobs_store=(store)
+ @@jobs_store = store
+ ActiveJob::Status.store = store
+ end
+
+ # Default to use Para::Cache::DatabaseStore, allowing cross process and
+ # app instances job status sharing
+ #
+ def self.jobs_store
+ @@jobs_store ||= Para::Cache::DatabaseStore.new
+ end
+
+ # The DatabaseStore cache system tries to clean up old keys when reaching
+ # that limit after writing new keys
+ #
+ mattr_accessor :database_cache_store_max_items
+ @@database_cache_store_max_items = 10000
# Allows accessing plugins root module to configure them through a method
# from the Para::Config class.
#
# Example :