Module: Shared::Taggable

Extended by:
ActiveSupport::Concern
Included in:
AssertedDistribution, BiocurationClass, BiologicalRelationship, Citation, CollectingEvent, CollectionObject, CollectionObjectObservation, CollectionProfile, CommonName, Container, Depiction, Document, Documentation, Georeference, Image, Loan, LoanItem, Note, Otu, PreparationType, Serial, Source, SqedDepiction, TaxonName, Topic, TypeMaterial, User
Defined in:
app/models/concerns/shared/taggable.rb

Overview

Shared code for extending data-classes with Tags.

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary (collapse)

Instance Method Details

- (Object) reject_tags(attributed) (protected)



45
46
47
48
49
# File 'app/models/concerns/shared/taggable.rb', line 45

def reject_tags(attributed)
  (attributed['keyword'].blank? && attributed['keyword_id'].blank?) && 
    attributed['position'].blank? && 
    attributed['keyword_attributes'].blank?   
end

- (Boolean) tagged?

Returns:

  • (Boolean)


29
30
31
# File 'app/models/concerns/shared/taggable.rb', line 29

def tagged?
  self.tags.any?
end