Sha256: ebbab31696462e2e7f859e5e7211a0e4d86549517200f260d8b925feed991449

Contents?: true

Size: 1.21 KB

Versions: 18

Compression:

Stored size: 1.21 KB

Contents

require 'rails_admin/config/proxyable'
require 'rails_admin/config/configurable'
require 'rails_admin/config/has_fields'
require 'rails_admin/config/has_groups'

module RailsAdmin
  module Config
    module Sections
      # Configuration of the show view for a new object
      class Base
        include RailsAdmin::Config::Proxyable
        include RailsAdmin::Config::Configurable

        include RailsAdmin::Config::HasFields
        include RailsAdmin::Config::HasGroups

        attr_reader :abstract_model
        attr_reader :parent, :root

        def initialize(parent)
          @parent = parent
          @root = parent.root

          @abstract_model = root.abstract_model
        end

        def inspect
          "#<#{self.class.name} #{
            instance_variables.map do |v|
              value = instance_variable_get(v)
              if [:@parent, :@root, :@abstract_model].include? v
                if value.respond_to? :name
                  "#{v}=#{value.name.inspect}"
                else
                  "#{v}=#{value.class.name}"
                end
              else
                "#{v}=#{value.inspect}"
              end
            end.join(", ")
          }>"
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
rails_admin-0.6.0 lib/rails_admin/config/sections/base.rb
rails_admin-0.5.0 lib/rails_admin/config/sections/base.rb
rails_admin-0.4.9 lib/rails_admin/config/sections/base.rb
rails_admin-0.4.8 lib/rails_admin/config/sections/base.rb
rails_admin-0.4.7 lib/rails_admin/config/sections/base.rb
rails_admin-0.4.6 lib/rails_admin/config/sections/base.rb
rails_admin-0.4.5 lib/rails_admin/config/sections/base.rb
rails_admin-0.4.4 lib/rails_admin/config/sections/base.rb
rails_admin-lbgraham-0.4.2 lib/rails_admin/config/sections/base.rb
rails_admin-0.4.3 lib/rails_admin/config/sections/base.rb
rails_admin-0.4.2 lib/rails_admin/config/sections/base.rb
rails_admin-0.4.1 lib/rails_admin/config/sections/base.rb
rails_admin-0.4.0 lib/rails_admin/config/sections/base.rb
rails_admin-0.3.0 lib/rails_admin/config/sections/base.rb
rails_admin-0.2.0 lib/rails_admin/config/sections/base.rb
rails_admin-0.1.2 lib/rails_admin/config/sections/base.rb
rails_admin-0.1.1 lib/rails_admin/config/sections/base.rb
rails_admin-0.1.0 lib/rails_admin/config/sections/base.rb