Sha256: 60a2fe84a8c2451c22da39722afc385c559b0e2bbd55b50da6e095fc23989ea2

Contents?: true

Size: 740 Bytes

Versions: 114

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

114 entries across 114 versions & 1 rubygems

Version Path
cm-admin-1.5.28 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.5.10 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.5.27 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.5.26 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.5.25 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.5.23 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.5.22 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.5.21 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.5.20 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.5.11 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.5.9 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.5.8 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.5.7 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.5.6 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.5.1 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.5.0 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.4.9 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.4.8 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.4.7 lib/cm_admin/view_helpers/action_dropdown_helper.rb
cm-admin-1.4.6 lib/cm_admin/view_helpers/action_dropdown_helper.rb