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
-
#tag!(tag) ⇒ Object
Attaches the given string to the version tag column.
-
#tagged? ⇒ Boolean
Simply returns a boolean signifying whether the version instance has a tag value attached.
- #validate_tags? ⇒ Boolean
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.
33 34 35 36 |
# File 'lib/vestal_versions/version_tagging.rb', line 33 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.
39 40 41 |
# File 'lib/vestal_versions/version_tagging.rb', line 39 def tagged? !tag.nil? end |
#validate_tags? ⇒ Boolean
43 44 45 |
# File 'lib/vestal_versions/version_tagging.rb', line 43 def tagged? && tag != 'deleted' end |