module Scopie

Constants

RESULTS_TO_IGNORE
VERSION

Public Class Methods

apply_scopes(target, hash, method: nil, scopie: Scopie::Base.new) click to toggle source

Receives an object where scopes will be applied to.

class GraduationsScopie < Scopie::Base
  has_scope :featured, type: :boolean
  has_scope :by_degree, :by_period
end

class GraduationsController < ApplicationController
  def index
    @graduations = Scopie.apply_scopes(Graduation, method: :index, scopie: GraduationsScopie.new).all
  end
end
# File lib/scopie.rb, line 24
def self.apply_scopes(target, hash, method: nil, scopie: Scopie::Base.new)
  scopie.apply_scopes(target, hash, method)
end
current_scopes(hash, method: nil, scopie: Scopie::Base.new) click to toggle source

Returns the scopes used in this action.

# File lib/scopie.rb, line 29
def self.current_scopes(hash, method: nil, scopie: Scopie::Base.new)
  scopie.current_scopes(hash, method)
end