Module: Housekeeping

Extended by:
ActiveSupport::Concern
Included in:
AssertedDistribution, BiocurationClassification, BiologicalAssociation, BiologicalAssociationsBiologicalAssociationsGraph, BiologicalAssociationsGraph, BiologicalRelationship, BiologicalRelationshipType, Citation, CitationTopic, CollectingEvent, CollectionObject, CollectionObjectObservation, CollectionProfile, CommonName, Confidence, Container, ContainerItem, ContainerLabel, Content, ControlledVocabularyTerm, DataAttribute, Depiction, DerivedCollectionObject, Document, Documentation, DwcOccurrence, Georeference, Identifier, Image, Loan, LoanItem, Note, OriginRelationship, Otu, OtuPageLayout, OtuPageLayoutSection, PinboardItem, ProjectSource, Protocol, ProtocolRelationship, PublicContent, RangedLotCategory, Role::ProjectRole, SqedDepiction, Tag, TaggedSectionKeyword, TaxonDetermination, TaxonName, TaxonNameAuthor, TaxonNameClassification, TaxonNameRelationship, TypeDesignator, TypeMaterial
Defined in:
lib/housekeeping.rb

Defined Under Namespace

Modules: AssociationHelpers, CombinedScopes, Projects, Timestamps, Users

Instance Method Summary (collapse)

Instance Method Details

- (Boolean) has_polymorphic_relationship?

Returns:

  • (Boolean)


12
13
14
# File 'lib/housekeeping.rb', line 12

def has_polymorphic_relationship?
  self.class.reflect_on_all_associations(:belongs_to).select{|a| a.polymorphic?}.count > 0
end