Module: VestalVersions::TaggingVersionMethods

Extended by:
ActiveSupport::Concern
Defined in:
lib/vestal_versions/version_tagging.rb

Overview

Instance methods included into VestalVersions::Version to enable version tagging.

Instance Method Summary collapse

Instance Method Details

#tag!(tag) ⇒ Object

Attaches the given string to the version tag column. If the uniqueness validation fails, nil is returned. Otherwise, the given string is returned.



35
36
37
38
# File 'lib/vestal_versions/version_tagging.rb', line 35

def tag!(tag)
  write_attribute(:tag, tag)
  save ? tag : nil
end

#tagged?Boolean

Simply returns a boolean signifying whether the version instance has a tag value attached.

Returns:

  • (Boolean)


41
42
43
# File 'lib/vestal_versions/version_tagging.rb', line 41

def tagged?
  !tag.nil?
end

#validate_tags?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/vestal_versions/version_tagging.rb', line 45

def validate_tags?
  tagged? && tag != 'deleted'
end