Sha256: a66dddff7c74b12b81fa0782a31907f15b62834f27cc0e00726b2a6e0d50629b
Contents?: true
Size: 926 Bytes
Versions: 2
Compression:
Stored size: 926 Bytes
Contents
module Administrate module Page class Base def initialize(dashboard, options = {}) @dashboard = dashboard @options = options end def resource_name @resource_name ||= dashboard.class.to_s.scan(/(.+)Dashboard/).first.first.underscore end def resource_path @resource_path ||= resource_name.tr("/", "_") end def collection_includes dashboard.try(:collection_includes) || [] end def item_includes dashboard.try(:item_includes) || [] end def item_associations dashboard.try(:item_associations) || [] end private def attribute_field(dashboard, resource, attribute_name, page) field = dashboard.attribute_type_for(attribute_name) field.new(attribute_name, nil, page, resource: resource) end attr_reader :dashboard, :options end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
administrate-1.0.0.beta3 | lib/administrate/page/base.rb |
administrate-1.0.0.beta2 | lib/administrate/page/base.rb |