Class: ActiveFedora::Associations::AssociationScope

Inherits:
Object
  • Object
show all
Defined in:
lib/active_fedora/associations/association_scope.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(association) ⇒ AssociationScope

Returns a new instance of AssociationScope.



13
14
15
# File 'lib/active_fedora/associations/association_scope.rb', line 13

def initialize(association)
  @association = association
end

Instance Attribute Details

#associationObject (readonly)

Returns the value of attribute association.



8
9
10
# File 'lib/active_fedora/associations/association_scope.rb', line 8

def association
  @association
end

Class Method Details

.scope(association) ⇒ Object



4
5
6
# File 'lib/active_fedora/associations/association_scope.rb', line 4

def self.scope(association)
  new(association).scope
end

Instance Method Details

#scopeObject



17
18
19
20
# File 'lib/active_fedora/associations/association_scope.rb', line 17

def scope
  scope = klass.unscoped
  add_constraints(scope)
end