Sha256: 6cf86a6f65fed0a6b8484c3654caa768a2aa9c55fcb706fe4cbd3d2687bf2b29

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

module ActiveScaffold::Config
  class Show < Base
    self.crud_type = :read

    def initialize(core_config)
      @core = core_config
      # start with the ActionLink defined globally
      @link = self.class.link.clone
      @action_group = self.class.action_group.clone if self.class.action_group
    end

    # global level configuration
    # --------------------------
    cattr_accessor :link
    @@link = ActiveScaffold::DataStructures::ActionLink.new('show', :label => :show, :type => :member, :security_method => :show_authorized?)
    # instance-level configuration
    # ----------------------------

    # the ActionLink for this action
    attr_accessor :link
    # the label for this action. used for the header.
    attr_writer :label
    def label
      @label ? as_(@label) : as_(:show_model, :model => @core.label(:count => 1))
    end

    # provides access to the list of columns specifically meant for this action to use
    def columns
      self.columns = @core.columns._inheritable unless @columns # lazy evaluation
      @columns
    end

    public :columns=
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_scaffold-3.0.12 lib/active_scaffold/config/show.rb
active_scaffold-3.0.11 lib/active_scaffold/config/show.rb