Sha256: 251880c2393c509b4b8ce43cd7b40d20cadd1cdb793b677e13d76e107f750b5f

Contents?: true

Size: 504 Bytes

Versions: 18

Compression:

Stored size: 504 Bytes

Contents

module Ddr::Models
  #
  # Since ActiveFedora does not yet (as of at least v9.9.1)
  # have named scopes, this module extends Base and is
  # included in AF::Relation for chainability.
  #
  module Relation
    def having_local_id(local_id)
      where(Ddr::Index::Fields::LOCAL_ID => local_id)
    end

    def in_collection(coll)
      where(Ddr::Index::Fields::IS_MEMBER_OF_COLLECTION => coll.respond_to?(:id) ? coll.id : coll)
    end
  end
end

ActiveFedora::Relation.include(Ddr::Models::Relation)

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ddr-models-3.0.8 lib/ddr/models/relation.rb
ddr-models-3.0.7 lib/ddr/models/relation.rb
ddr-models-3.0.6 lib/ddr/models/relation.rb
ddr-models-3.0.5 lib/ddr/models/relation.rb
ddr-models-3.0.4 lib/ddr/models/relation.rb
ddr-models-3.0.3 lib/ddr/models/relation.rb
ddr-models-3.0.2 lib/ddr/models/relation.rb
ddr-models-3.0.1 lib/ddr/models/relation.rb
ddr-models-3.0.0 lib/ddr/models/relation.rb
ddr-models-3.0.0.rc6 lib/ddr/models/relation.rb
ddr-models-3.0.0.rc5 lib/ddr/models/relation.rb
ddr-models-3.0.0.rc4 lib/ddr/models/relation.rb
ddr-models-3.0.0.rc3 lib/ddr/models/relation.rb
ddr-models-3.0.0.rc2 lib/ddr/models/relation.rb
ddr-models-3.0.0.rc1 lib/ddr/models/relation.rb
ddr-models-3.0.0.beta.22 lib/ddr/models/relation.rb
ddr-models-3.0.0.beta.21 lib/ddr/models/relation.rb
ddr-models-3.0.0.beta.20 lib/ddr/models/relation.rb