Sha256: 9b4504c9b4c6a86c7968cb1d16ba50698b7bf2aba6afe603ffef738e8d964dae

Contents?: true

Size: 1.69 KB

Versions: 34

Compression:

Stored size: 1.69 KB

Contents

module ActiveScaffold::Config
  class Base
    include ActiveScaffold::Configurable
    extend ActiveScaffold::Configurable

    def self.inherited(subclass)
      class << subclass
        # the crud type of the action. possible values are :create, :read, :update, :delete, and nil.
        # this is not a setting for the developer. it's self-description for the actions.
        def crud_type; @crud_type; end

        protected

        def crud_type=(val)
          raise ArgumentError, "unknown CRUD type #{val}" unless [:create, :read, :update, :delete].include?(val.to_sym)
          @crud_type = val.to_sym
        end
      end
    end

    # delegate
    def crud_type; self.class.crud_type end

    # the user property gets set to the instantiation of the local UserSettings class during the automatic instantiation of this class.
    attr_accessor :user

    # define a default action_group for this action
    # e.g. 'members.crud'
    class_inheritable_accessor :action_group

    # action_group this action should belong to
    attr_accessor :action_group

    class UserSettings
      def initialize(conf, storage, params)
        # the session hash relevant to this action
        @session = storage
        # all the request params
        @params = params
        # the configuration object for this action
        @conf = conf
      end
    end
    
    def formats
      @formats ||= []
    end
    
    def formats=(val)
      @formats=val
    end
    
    private
    
    def columns=(val)
      @columns = ActiveScaffold::DataStructures::ActionColumns.new(*val)
      @columns.action = self
      @columns.set_columns(@core.columns) if @columns.respond_to?(:set_columns)
      @columns
    end
  end
end

Version data entries

34 entries across 34 versions & 4 rubygems

Version Path
active_scaffold_vho-3.0.31 lib/active_scaffold/config/base.rb
active_scaffold_vho-3.0.30 lib/active_scaffold/config/base.rb
active_scaffold_vho-3.0.29 lib/active_scaffold/config/base.rb
active_scaffold_vho-3.0.28 lib/active_scaffold/config/base.rb
active_scaffold_vho-3.0.27 lib/active_scaffold/config/base.rb
active_scaffold_vho-3.0.26 lib/active_scaffold/config/base.rb
active_scaffold_vho-3.0.25 lib/active_scaffold/config/base.rb
active_scaffold-3.0.26 lib/active_scaffold/config/base.rb
active_scaffold-3.0.25 lib/active_scaffold/config/base.rb
active_scaffold_vho-3.0.24 lib/active_scaffold/config/base.rb
active_scaffold_clarity-3.0.24.2 lib/active_scaffold/config/base.rb
active_scaffold_vho-3.0.23 lib/active_scaffold/config/base.rb
active_scaffold_vho-3.0.22 lib/active_scaffold/config/base.rb
active_scaffold-3.0.24 lib/active_scaffold/config/base.rb
active_scaffold_vho-3.0.21 lib/active_scaffold/config/base.rb
active_scaffold-3.0.23 lib/active_scaffold/config/base.rb
active_scaffold-3.0.22 lib/active_scaffold/config/base.rb
active_scaffold-3.0.21 lib/active_scaffold/config/base.rb
active_scaffold_vho-3.0.20 lib/active_scaffold/config/base.rb
active_scaffold_vho-3.0.19 lib/active_scaffold/config/base.rb