Created
February 2, 2017 17:47
-
-
Save lukedemi/ec51c0fdeddb09cdbfe60b94891c680a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GeoEngineer::Resource | |
validate -> { validate_has_tag(:Name) if support_tags? } | |
validate -> { validate_has_tag(:ProjectName) if self.project? && support_tags? } | |
validate :validate_project_name_correct | |
def validate_project_name_correct | |
bad_name = support_tags? && self.project && tags['ProjectName'] != self.project.full_name | |
"ProjectName tag should equal \"#{project.full_name}\" for resource \"#{type}.#{id}\"" if bad_name | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment