lib/active_admin/resource.rb in activeadmin-0.5.0 vs lib/active_admin/resource.rb in activeadmin-0.5.1
- old
+ new
@@ -44,14 +44,21 @@
# If we're scoping resources, use this method on the parent to return the collection
attr_accessor :scope_to_association_method
# Set the configuration for the CSV
attr_writer :csv_builder
+
+ # Set breadcrumb builder
+ attr_accessor :breadcrumb
# Store a reference to the DSL so that we can dereference it during garbage collection.
attr_accessor :dsl
+ # The string identifying a class to decorate our resource with for the view.
+ # nil to not decorate.
+ attr_accessor :decorator_class_name
+
module Base
def initialize(namespace, resource_class, options = {})
@namespace = namespace
@resource_class_name = "::#{resource_class.name}"
@options = default_options.merge(options)
@@ -74,10 +81,14 @@
# will point to the Post class
def resource_class
ActiveSupport::Dependencies.constantize(resource_class_name)
end
+ def decorator_class
+ ActiveSupport::Dependencies.constantize(decorator_class_name) if decorator_class_name
+ end
+
def resource_table_name
resource_class.quoted_table_name
end
def resource_quoted_column_name(column)
@@ -161,8 +172,8 @@
end
def default_csv_builder
@default_csv_builder ||= CSVBuilder.default_for_resource(resource_class)
end
-
+
end # class Resource
end # module ActiveAdmin