Sha256: 89828f3eada1f98b77e80c8eb1caadf349811cd152e55fd1a063d6c606a9c478
Contents?: true
Size: 992 Bytes
Versions: 33
Compression:
Stored size: 992 Bytes
Contents
module Plutonium module Core module Actions class Collection delegate_missing_to :@collection def initialize(collection = {}) @collection = collection end def permitted_for(policy) Collection.new(@collection.select { |name, action| policy.allowed_to? :"#{action.name}?" }) end def collection_actions Collection.new(@collection.select { |name, action| action.collection_action? }) end def collection_record_actions Collection.new(@collection.select { |name, action| action.collection_record_action? }) end def record_actions Collection.new(@collection.select { |name, action| action.record_action? }) end def bulk_actions Collection.new(@collection.select { |name, action| action.bulk_action? }) end def values super.sort_by { |value| value.position } end end end end end
Version data entries
33 entries across 33 versions & 1 rubygems