Module: Ddr::Index::Filter::ClassMethods

Extended by:
Forwardable
Included in:
Ddr::Index::Filter
Defined in:
lib/ddr/index/filter.rb

Instance Method Summary collapse

Instance Method Details

#has_contentObject



78
79
80
# File 'lib/ddr/index/filter.rb', line 78

def has_content
  model "Ddr::Component", "Ddr::Attachment", "Ddr::Target"
end

#is_governed_by(arg) ⇒ Object



82
83
84
# File 'lib/ddr/index/filter.rb', line 82

def is_governed_by(arg)
  term admin_policy_id: get_join_id(arg)
end

#is_member_of_collection(arg) ⇒ Object



86
87
88
# File 'lib/ddr/index/filter.rb', line 86

def is_member_of_collection(arg)
  term is_member_of_collection: get_id(arg)
end

#is_part_of(arg) ⇒ Object



90
91
92
# File 'lib/ddr/index/filter.rb', line 90

def is_part_of(arg)
  term is_part_of: get_id(arg)
end

#model(*models) ⇒ Object



94
95
96
97
# File 'lib/ddr/index/filter.rb', line 94

def model(*models)
  namespaced_models = models.map{ |model| model.starts_with?("Ddr::") ? model : "Ddr::#{model}" }
  where resource_model: namespaced_models
end