Module: GroupedScope::ClassMethods

Defined in:
lib/grouped_scope/class_methods.rb

Instance Method Summary collapse

Instance Method Details

#grouped_scope(*associations) ⇒ Object



8
9
10
11
12
# File 'lib/grouped_scope/class_methods.rb', line 8

def grouped_scope(*associations)
  create_belongs_to_for_grouped_scope
  associations.each { |association| AssociationReflection.new(self,association) }
  create_grouped_scope_accessor
end

#grouped_scopesObject



4
5
6
# File 'lib/grouped_scope/class_methods.rb', line 4

def grouped_scopes
  read_inheritable_attribute(:grouped_scopes) || write_inheritable_attribute(:grouped_scopes, {})
end