Sha256: bb9ce6d4476589aef2b1f9316be4c4259c13d9948a210262f62120ebaa883da7

Contents?: true

Size: 639 Bytes

Versions: 24

Compression:

Stored size: 639 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!
        class_exec do
          def self.resource_class=(klass); end

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

          private

          def resource_class
            self.class.resource_class
          end
        end
      end

    end
  end
end

Version data entries

24 entries across 24 versions & 3 rubygems

Version Path
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/activeadmin-2.9.0/lib/active_admin/resource_controller/resource_class_methods.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/activeadmin-2.9.0/lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin-2.9.0 lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin-2.8.1 lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin-2.8.0 lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin-2.7.0 lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin-2.6.1 lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin-2.6.0 lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin-2.5.0 lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin-2.4.0 lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin-2.3.1 lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin-2.3.0 lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin-2.2.0 lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin-2.1.0 lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin-2.0.0 lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin-2.0.0.rc2 lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin_addons-1.7.1 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin-2.0.0.rc1 lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin_addons-1.7.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/resource_controller/resource_class_methods.rb
activeadmin_addons-1.6.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/lib/active_admin/resource_controller/resource_class_methods.rb