Module: VestalVersions::VersionTagging::VersionMethods

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

- (Object) tag!(tag)

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



33
34
35
36
# File 'lib/vestal_versions/version_tagging.rb', line 33

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

- (Boolean) tagged?

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

Returns:

  • (Boolean)


39
40
41
# File 'lib/vestal_versions/version_tagging.rb', line 39

def tagged?
  !tag.nil?
end

- (Boolean) validate_tags?

Returns:

  • (Boolean)


43
44
45
# File 'lib/vestal_versions/version_tagging.rb', line 43

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