def scope(name, proc=nil, &block)
      define_method(name) do |*args|
        @queryable = queryable.instance_exec *args, &(proc || block)
        self
      end
    end
def scope(name, proc=nil, &block)
      define_method(name) do |*args|
        @queryable = queryable.instance_exec *args, &(proc || block)
        self
      end
    end
Public: Defines a new method that executes the passed proc or block in
 the context of the internal query object, and returns self.

 name - Name of the scope to define for this Queryable.

 proc - An optional proc or lambda to be executed in the context of the
        the current query.

 block - An optional block to be executed in the context of the current
         query.

 Yields the arguments given to the scope when invoked, generally none.

 Examples

   scope :active, ->{ where(status: 'active') }

   scope(:recent) { desc(:created_at) }

   scope :of_brand do |brand|
     where(_type: "#{brand}ExtremelyFastRacingCar")
   end

 Returns nothing.