lib/para/config.rb in para-0.5.1 vs lib/para/config.rb in para-0.5.3

- old
+ new

@@ -16,15 +16,22 @@ @@default_tree_max_depth = 3 mattr_accessor :resource_name_methods @@resource_name_methods = [:admin_name, :admin_title, :name, :title] + mattr_accessor :plugins + @@plugins = [] + + # 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 :plugins - @@plugins = [] + mattr_accessor :page_actions + @@page_actions = {} # Allows accessing plugins root module to configure them through a method # from the Para::Config class. # # Example : @@ -38,8 +45,20 @@ plugin = Para::Plugins.module_name_for(method_name).constantize block ? block.call(plugin) : plugin else super end + end + + def self.routes + Para::Routes + end + + def self.page_actions_for(type) + page_actions[type] ||= [] + end + + def self.add_actions_for(type, &block) + page_actions_for(type) << block end end end