Sha256: 60a2fe84a8c2451c22da39722afc385c559b0e2bbd55b50da6e095fc23989ea2

Contents?: true

Size: 740 Bytes

Versions: 101

Compression:

Stored size: 740 Bytes

Contents

module CmAdmin
  module ViewHelpers
    module ActionDropdownHelper
      def available_actions(cm_model, ar_object, action_type)
        if action_type.eql?('custom_actions')
          cm_model.available_actions.select {
            |act| act if act.route_type.eql?('member') &&
                         [:button, :modal].include?(act.display_type) &&
                         act.name.present? &&
                         has_valid_policy(ar_object, act.name)
          }
        else
          cm_model.available_actions.select {
            |act| act if act.action_type.eql?(:default) &&
                         act.name.eql?(action_type)
          } if has_valid_policy(ar_object, action_type)
        end
      end
    end
  end
end

Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
cm-admin-3.0.15 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-3.0.14 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-3.0.13 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-3.0.12 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-3.0.11 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-3.0.10 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-3.0.9 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-3.0.8 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-3.0.7 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-3.0.6 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-3.0.5 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-3.0.4 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-3.0.3 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-3.0.2 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-3.0.1 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-3.0.0 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.4.6 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.4.5 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.4.4 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-2.4.3 lib/cm_admin/view_helpers/action_dropdown_helper.rb