Module: Enscoped

Defined in:
lib/enscoped.rb

Overview

Usage:

class FancyModel < ActiveRecord::Base
  include Enscoped
  named_scope :informative
  named_scope :entertaining
  named_scope :brief
  named_scope :verbose
  named_scope :boring
  named_scope :exciting
  named_scope :free
  named_scope :expensive
end

# execute a query
FancyModel.enscoped(:informative, :entertaining).count

# just the hash condition
FancyModel.scope_for_scopes(:free, :expensive)

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



25
26
27
# File 'lib/enscoped.rb', line 25

def self.included(base)
  base.extend(ClassMethods)
end