Sha256: c1339162613bc6b7af86786548ca121f6b49ce904287e5672b0224267411ef7e

Contents?: true

Size: 430 Bytes

Versions: 1

Compression:

Stored size: 430 Bytes

Contents

module ModelExplorer
  module Scopes
    extend ActiveSupport::Concern

    included do
      extend ClassMethods
    end

    module ClassMethods
      def scope(name, body)
        if body&.respond_to?(:parameters) && body.parameters.blank?
          (@_model_explorer_scopes ||= []) << name
        end

        super
      end

      def model_explorer_scopes
        @_model_explorer_scopes || []
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
model_explorer-0.1.0 lib/model_explorer/scopes.rb