Sha256: ef694fd805289df1330f622f055b3b318812cdd562b29e59a6d37e1ea0d399ad

Contents?: true

Size: 623 Bytes

Versions: 59

Compression:

Stored size: 623 Bytes

Contents

module ActiveAdmin
  class ResourceController < BaseController
    module ResourceClassMethods

      # Override the default resource_class class and instance
      # methods to only return the class defined in the instance
      # of ActiveAdmin::Resource
      def override_resource_class_methods!
        self.class_eval do
          def self.resource_class=(klass); end

          def self.resource_class
            @active_admin_config ? @active_admin_config.resource_class : nil
          end

          def resource_class
            self.class.resource_class
          end
        end
      end

    end
  end
end

Version data entries

59 entries across 59 versions & 3 rubygems

Version Path
lalala-4.0.0.dev.141 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.136 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.135 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.134 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.133 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.132 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.131 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.129 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.128 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.126 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.125 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.124 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.123 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.118 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.116 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.114 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.113 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.111 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.109 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb
lalala-4.0.0.dev.107 vendor/deps/active_admin/lib/active_admin/resource_controller/resource_class_methods.rb